-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
torchvision.io.read_image support processing EXIF information in JPEG file #7977
Comments
Thanks for opening this issue @kero-ly . From #7947 (comment) it looks like PIL and torchvision provide the same output dimensions (they agree on H and W, despite different conventions) and seem to ignore the EXIF information. I guess we could add support for that... as a bug fix? But the fact that PIL ignores it as well makes me wonder whether there's something we're missing here. Any thought @pmeier @vfdev-5 ? |
Maybe this is intentional on PILs side? If so, we should not "fix" this behavior on our side since we align with PIL. I'm ok with adding a flag like |
@pmeier @NicolasHug , can I try to work on this? (i.e. adding a flag like |
Sure, go ahead @Zekrom-7780! |
Hello, are there updates regarding this feature? I recently switched to |
@gau-nernst @kero-ly I'll be working on this feature, could you please provide few examples with exif data with defined orientation to test on. Thanks. |
@vfdev-5 I found some samples here: https://github.com/recurser/exif-orientation-examples For example, the one below needs to be rotated clock-wise. wget https://raw.githubusercontent.com/recurser/exif-orientation-examples/master/Landscape_6.jpg For testing against PIL, I use this from PIL import Image, ImageOps
img = Image.open("path.jpg")
img = ImageOps.exif_transpose(img) My browser (Edge) also seems to display all the samples from https://github.com/recurser/exif-orientation-examples correctly. |
🚀 The feature
In #7947, I found that torchvision.io.read_image will not process the EXIF information in JPEG file.
I'm wondering if PyTorch will consider supporting processing EXIF information in the future versions?
Motivation, pitch
I have millions of images in my project, some JPEG files have orientation tag in EXIF information. If I use torchvision.io.read_image to read them directly, the model accuracy seems not good enough since some images have the wrong orientation.
I want to ask if PyTorch will provide a convenient way to process the orientation tag?
Alternatives
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: