(self, img)
return transforms.functional.crop(img, i, j, size[0], size[1])
Args:
            img (PIL Image): Image to be cropped.
        Returns:
            PIL Image: Cropped image.
Args:
            img (PIL Image): Image to be cropped.
        Returns:
            PIL Image: Cropped image.
Args : img ( PIL Image ) : Image to be cropped . Returns : PIL Image : Cropped image .
def __call__(self, img):
        """
        Args:
            img (PIL Image): Image to be cropped.
        Returns:
            PIL Image: Cropped image.
        """
        size = (min(img.size), min(img.size))
        # Only step forward along this edge if it's the long edge
        i = (0 if size[0] == img.size[0]
             else np.random.randint(low=0, high=img.size[0] - size[0]))
        j = (0 if size[1] == img.size[1]
             else np.random.randint(low=0, high=img.size[1] - size[1]))
        return transforms.functional.crop(img, i, j, size[0], size[1])
def __call__ ( self , img ) : size = ( min ( img . size ) , min ( img . size ) ) # Only step forward along this edge if it's the long edge i = ( 0 if size [ 0 ] == img . size [ 0 ] else np . random . randint ( low = 0 , high = img . size [ 0 ] - size [ 0 ] ) ) j = ( 0 if size [ 1 ] == img . size [ 1 ] else np . random . randint ( low = 0 , high = img . size [ 1 ] - size [ 1 ] ) ) return transforms . functional . crop ( img , i , j , size [ 0 ] , size [ 1 ] )