Tensor image show

When I show image tensor

I use

img = images.numpy().transpose(1, 2, 0)
plt.imshow(img)
plt.show()

But the color is wrong. Can anybody help me??

Thanks ahead.

Hi,

For imshow, if the image is 3 channel / RGB, the pixel values should be [0-1] float or [0-255] int. I feel that the problem is coming from data type of pixel values.

If it does not fix your issue, please print some values in img.

Thanks

1 Like