I am building a custom Dataset object to format and iterate though my data set for a img-seq project I am working on. I am using the torchvision.io.read_image()
function to load in a given image as a tensor.
I am using the following code to validate the functionality of read_image()
and I am seeing some odd behavior.
img2 = read_image(tmp_img_dir)
img2 = T.ToPILImage()(img2)
img2.show()
where tmp_img_dir
is simply an absolute path to a .png image.
I will include the original image and the one displayed by .show()
As you can see the image appears to be compressed leftwards. This does not occur when reading in this image using any other python library such as PIL or matplotlib.image.
Is this error a result of the way in which i am displaying the image or my use of the read_image() function?
If anyone has seen this before please do tell!