Yeah this frustrated me a lot too because it’s so easy with itorch… You have a few options with python but there’s not a stand-alone command that I’m aware of for displaying an image from a PyTorch Tensor. If you convert to a PIL image then you can just execute the Image variable in a cell and it will display the image. To load to PIL:
img = Image.open('path-to-image-file').convert('RGB')
Or to convert straight from a PyTorch Tensor:
to_pil = torchvision.transforms.ToPILImage()
img = to_pil(your-tensor)
Other than that, there’s the usual matplotlib
plt.show() using numpy, and if you’ve used cv2 there are cv2 equivalents. In python it’s kind of whatever you get comfortable with, although apparently opencv might be faster performance-wise.