-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
Put load_image
function in image_utils.py
& fix image rotation issue
#14062
Conversation
Which version of Pillow are you using ? transformers doesn't specify a version.
|
also, I get rotated mask results from Inference API, which is how I encountered this issue |
I think we need to add some form of test to expose the necessity for this as it's not trivial and might be fixed upstream (as it claims to be). So we need an image file (can be in |
@Narsil Should I use this opportunity to address (src):
If so, should I just make |
Just put the function outside the class, it's a simple function it doesn't deserve a mixin. In another branch I added (It's the first thing that popped in mind in terms of location, maybe we can find a better location ultimately, here goal is just to reduce repetition) |
load_image
function in image_utils.py
& fix image rotation issue
@Narsil please feel free to re-review this PR. I've added the changes as suggested. transformers/tests/test_image_utils.py Lines 436 to 442 in dd6d891
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! It's indeed better to add the load_image
function into image_utils.py
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to move it there!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great change, LGTM
Before merging, there seems to be a few tests failing linked to your PR! |
@LysandreJik thanks for notifying about the failing tests. Solved! There was an issue with the |
What does this PR do?
load_image
function inimage_utils.py
PIL.Image.open is rotating jpeg images
PIL.Image.open is rotating jpeg images python-pillow/Pillow#4703Fixes # (issue)
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.