You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from PIL import Image
img3 = Image.open("1.jpg")
print(img3.size)
the result is
(201, 151)
try with torchvison.io
import torchvision as tv
img4 = tv.io.read_image("1.jpg")
print(img4.shape)
the result is
torch.Size([3, 151, 201])
The result of torchvison.io is in [image_channels, image_height, image_width] format, which means the image is not rotated. However, opencv and pillow will deal with the EXIF information and rotate the image to the correct orientation.
I wonder if torchvision.io.read_image misses the EXIF information in jpeg or not?
Thanks for your reply! I wonder if PyTorch will support dealing with the EXIF info in future versions? I prefer to use torch API or PIL API in my project, otherwise I could not process image with EXIF info @pmeier
🐛 Describe the bug
EXIF image:
I have a JPEG image above with EXIF information and I tried to load this image into pytorch for augmentation.
the result is
the result is
the result is
The result of torchvison.io is in [image_channels, image_height, image_width] format, which means the image is not rotated. However, opencv and pillow will deal with the EXIF information and rotate the image to the correct orientation.
I wonder if torchvision.io.read_image misses the EXIF information in jpeg or not?
Versions
Name: torchvision
Version: 0.9.1
Summary: image and video datasets and models for torch deep learning
Home-page: https://github.com/pytorch/vision
Name: Pillow
Version: 9.4.0
Summary: Python Imaging Library (Fork)
Home-page: https://python-pillow.org
The text was updated successfully, but these errors were encountered: