-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Add do_convert_rgb to vit #34523
Add do_convert_rgb to vit #34523
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.
Hi @jp1924, thanks for adding this feature! To make it complete we also have to update VitImageProcessorFast
to be compatible with this image processor. Please have a look if there is a required transform in torchvision or use Lambda transform. Thanks!
Co-authored-by: Pavel Iakubovskii <[email protected]>
Co-authored-by: Pavel Iakubovskii <[email protected]>
Co-authored-by: Pavel Iakubovskii <[email protected]>
Thanks for the advice @qubvel! That worked out well. I wrote that type_hint with reference to siglip, should I modify siglip as well? |
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.
Hi @jp1924, thanks for the update! For fast image processor we also should add a transform that do RGB conversion, not only an argument.
@qubvel |
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 update! Looks good to me!
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
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 but as this was not requested before I am not entirely sure it will be used! 🤗
* Add: do_convert_rgb * Add: doc string * Update src/transformers/models/vit/image_processing_vit.py Co-authored-by: Pavel Iakubovskii <[email protected]> * Update src/transformers/models/vit/image_processing_vit.py Co-authored-by: Pavel Iakubovskii <[email protected]> * Update src/transformers/models/vit/image_processing_vit.py Co-authored-by: Pavel Iakubovskii <[email protected]> * Add: do_convert_rgb to fast * Add: convert_to_rgb --------- Co-authored-by: Pavel Iakubovskii <[email protected]>
* Add: do_convert_rgb * Add: doc string * Update src/transformers/models/vit/image_processing_vit.py Co-authored-by: Pavel Iakubovskii <[email protected]> * Update src/transformers/models/vit/image_processing_vit.py Co-authored-by: Pavel Iakubovskii <[email protected]> * Update src/transformers/models/vit/image_processing_vit.py Co-authored-by: Pavel Iakubovskii <[email protected]> * Add: do_convert_rgb to fast * Add: convert_to_rgb --------- Co-authored-by: Pavel Iakubovskii <[email protected]>
What does this PR do?
While resolving issue #34301, discovered that ViT lacks do_rgb_convert.
Therefore, added do_rgb_convert to ViTImageProcessor.
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@amyeroberts, @qubvel