def __call__(self, mask, flip=False):
     mask, scale_factor = imrescale(mask, self.scale)
     if flip:
         mask = img_flip(mask)
     if self.pad_mode == 'fixed':
         mask = impad_mask_to_square(mask, self.impad_size)
     else:
         mask = impad_mask_to_multiple(mask, self.impad_size)
     return mask
    def __call__(self, img, flip=False):
        img, scale_factor = imrescale(img, self.scale)
        img_shape = img.shape

        if flip:
            img = img_flip(img)
        if self.pad_mode == 'fixed':
            img = impad_to_square(img, self.impad_size)

        else:  # 'non-fixed'
            img = impad_to_multiple(img, self.impad_size)

        return img, img_shape, scale_factor