Exemplo n.º 1
0
    def __call__(self, img, target):
        """
            img (PIL Image): Image to be rotated.

        Returns:
            PIL Image: Rotated image.
        """

        angle = self.get_params(self.degrees)

        return F.rotate(img, angle, self.resample, self.expand, self.center), F.rotate(target, angle, self.resample, self.expand, self.center)
Exemplo n.º 2
0
    def __call__(self, img):
        """
            img (numpy ndarray): Image to be rotated.
        Returns:
            numpy ndarray: Rotated image.
        """

        angle = self.get_params(self.degrees)

        return F.rotate(img, angle, self.resample, self.expand, self.center)
Exemplo n.º 3
0
 def __call__(self, img):
     angle = random.uniform(self.degrees[0], self.degrees[1])
     return F.rotate(img, angle)
Exemplo n.º 4
0
    def __call__(self, img):
        angle = random.uniform(self.degrees[0], self.degrees[1])

        return F.rotate(img, angle, self.resample, self.expand, self.center)