def compose(transforms):
    """
    return a function which will apply sequentially the transforms function to an image and its label

    :param transforms: list of transform functions
    :return: a function
    """

    def sequential_apply(img, lbl):
        for tf in transforms:
            img, lbl = tf(img, lbl)
        return img, lbl

    return sequential_apply