from PIL import Image from torchvision.transforms import ToTensor img = Image.open("D:\\Downloads\\IMG_20240226_121645.jpg") toTensor = ToTensor() img = toTensor(img) Shape of PIL: [Height, Width, Channels] Shape of PyTorch: [Batch, Channels, Height, Width] Settings - Live Templates: Add to Python: Abbreviation:debug_show Template text: import matplotlib.pyplot as plt import numpy pic = $VAR_NAME$ #cpu #pic = numpy.transpose(pic, axes=[1, 2, 0]) #cuda pic = numpy.transpose(pic.cpu(), axes=[1, 2, 0]) plt.imshow(pic, cmap='gray') plt.show() Change:Python Useage: Debug Mode - Mouse Right Button - Evaluate Expression Input debug_show and varname