-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
Fix: siglip image processor rgb_convert is not being applied correctly. #34301
Fix: siglip image processor rgb_convert is not being applied correctly. #34301
Conversation
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.
Good catch @jp1924 ! - I checked, it seems Siglip was the only exception with the wrong order of operations.
@molbap |
There's no particular reason why - I have no opposition to introducing this in another PR :) |
@molbap |
@jp1924, sure, no opposition to it - the main thing we are careful about is not breaking backwards compatibility. In this case, no previous behaviour can be broken since you're adding a functionality, so feel free to open a PR :) |
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.
Thanks for the fix, indeed convert_rgb is not supported for numpy arrays! I suppose we can merge this fix!
Also would be great to update convert_rgb
to avoid silently skipping numpy arrays.
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.
thanks 🤗
…y. (huggingface#34301) Fix: do_convert_rgb
…y. (huggingface#34301) Fix: do_convert_rgb
What does this PR do?
The convert_to_rgb function is not being applied because ndarray values are being input
(convert_to_rgb simply returns the input value if it's not a PIL.Image).
If an image with RGBA or similar format is input, the conversion doesn't work properly,
causing the following error in the infer_channel_dimension_format method:
transformers
version: 4.46.0.dev0Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@amyeroberts