def __call__(self, img, augmentation=False, box=None):
        """
        Args:
            img (PIL Image): Image to be cropped and resized.
        Returns:
            PIL Image: Randomly cropped and resized image.
        """
        if augmentation:
            i, j, h, w = self.get_params(img, self.scale, self.ratio)
            img = F.crop(img, i, j, h, w)
            # img, box = crop(img, i, j, h, w, box)
        img = F.resize(img, self.size, self.interpolation)
        second_img = F.resize(img, self.second_size, self.second_interpolation) \
            if self.second_size is not None else None
        return img, second_img

        Args:
            img (PIL Image): Image to be cropped and resized.
        Returns:
            PIL Image: Randomly cropped and resized image.
        
layoutlmv3/layoutlmft/data/image_utils.py