-
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
Loading 16bit png images #2218
Comments
What was the solution for this issue ? |
@shubhamsidhwa If you don't set a vision/torchvision/datasets/folder.py Lines 264 to 269 in 90a6206
is used. Since vision/torchvision/datasets/folder.py Lines 247 to 251 in 90a6206
Their documentation states:
My guess would be that you are hitting a case where To overcome this you can set a custom |
Pillow is kinda bad at reading 16bits grayscale pngs (e.g. python-pillow/Pillow#3011), so I'm not sure this is a torchvision issue, more probably a PIL problem. I marked this issue to be closed once #4657 is merged: from that point you'll be able to read 16 bits pngs natively in torchvision with |
ported here from pytorch/pytorch#32971
Original description:
When I was trying to load 16 bit .png grayscale image with torchvision.datasets.imagefolder ,it is loading every image as white only.
I solved this issue by doing transformation operations outside Compose function.
cc @pmeier @wanifarooq @choidongyeon
The text was updated successfully, but these errors were encountered: