def __call__ ( self , img ) : return F . pad ( img , self . padding , self . fill , self . padding_mode )
easiest way to pad an image python
Args : img ( PIL Image ) : Image to be padded .
def __call__(self, img):
        """
        Args:
            img (PIL Image): Image to be padded.

        Returns:
            PIL Image: Padded image.
        """
        return F.pad(img, self.padding, self.fill, self.padding_mode)