I want to make some transformations outside the Dataloader with torchvision.transforms.
ColorJitter
. However, when I use hue!= 0
, I receive:
a = torch.randn(3, 128, 128)
a_T = torchvision.transforms.ColorJitter(brightness=0.5, contrast=0.5, saturation=0.5, hue=0)(a) # works
a_t = torchvision.transforms.ColorJitter(brightness=0.5, contrast=0.5, saturation=0.5, hue=0.5)(a) # error
TypeError: img should be PIL Image. Got <class ‘torch.Tensor’>
With hue=0 it works, so apparently there seems to be a bug. Can someone confirm this or explain how to work around that issue?