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)
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)
def __call__(self, img): angle = random.uniform(self.degrees[0], self.degrees[1]) return F.rotate(img, angle)
def __call__(self, img): angle = random.uniform(self.degrees[0], self.degrees[1]) return F.rotate(img, angle, self.resample, self.expand, self.center)