This topic has been posted before on forums but they seem to be outdated now.
Is there a way of using the torchvision transform.ToPilImage() function on n-dimensional numpy arrays which aren’t 3 channels?
I’ve attempted to do this with single channel images but I get errors due to image shaping I think.
My method for when image.shape == (N,N,1):
transform = transforms.Compose([transforms.ToPilImage(), transforms.ToTensor, transforms.Normalize([0.5],[0.5])])