def to_match_dict(config, label, bounding_box, mask):
    """Return properly formatted dict that can be extracted by match_to_tuple.

    :param GenerationConfig config: configuration object with keys
    JSON_LABEL_KEY, JSON_BOUNDING_BOX_KEY, JSON_MASK_KEY
    :param str label: label
    :param tuple bounding_box: bounding box tuple as ((x1,y1), (x2,y2))
    :param np.array mask: mask image
    :return: properly formatted dict"""
    return {
        config.JSON_LABEL_KEY: label,
        config.JSON_BOUNDING_BOX_KEY: bounding_box,
        config.JSON_MASK_KEY: mask.tolist()
    }