-
Notifications
You must be signed in to change notification settings - Fork 30.2k
add general hub test for Fast Image Processors in test_image_processing_utils #40086
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
base: main
Are you sure you want to change the base?
Conversation
Test Result: $ python -m unittest tests/utils/test_image_processing_utils.py
.sssssssss.Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.
/home/elicer/.local/lib/python3.10/site-packages/transformers/models/clip/feature_extraction_clip.py:30: FutureWarning: The class CLIPFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please use CLIPImageProcessor instead.
warnings.warn(
..
----------------------------------------------------------------------
Ran 13 tests in 1.549s
OK (skipped=9) |
cc @yonigozlan |
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 @namgyu-youn ! Thanks for contributing, ok to merge this for me after removing the redundant test, but let's change the name of the PR, as this adds general image processor tests, taking ViT image processors as an example.
There are already unit tests for Vit image processors in /tests/models/vit/test_image_processing_vit.py
, so the title is a bit misleading
def test_vit_processors_compatibility(self): | ||
processor = ViTImageProcessor.from_pretrained("hf-internal-testing/tiny-random-vit") | ||
processor_fast = ViTImageProcessorFast.from_pretrained("hf-internal-testing/tiny-random-vit") | ||
|
||
# Check that both processors have similar configurations | ||
self.assertEqual(processor.size, processor_fast.size) | ||
self.assertEqual(processor.do_resize, processor_fast.do_resize) | ||
self.assertEqual(processor.do_rescale, processor_fast.do_rescale) | ||
self.assertEqual(processor.do_normalize, processor_fast.do_normalize) |
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.
we have extensive tests for this already, no need to add here
ViTImageProcessorFast
ViTImageProcessorFast
ViTImageProcessorFast
@yonigozlan Please feel free to rename title if there is a better one. |
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.
Alright @yonigozlan, if you think the tests are useful feel free to merge it! Thanks @namgyu-youn! 🤗
@yonigozlan Hi, I have a question before merging this PR. As we know, there are many image processor ( SkipTest happens if Actually, I already opened a PR (#40124) for this. Could you check #40124 ? If it is, I want to apply it across the image processor ( |
@ArthurZucker @Cyrilvallez @yonigozlan Could you please merge this PR? It hasn't merged yet after 3 approval. |
What does this PR do?
There was no test module for
ViTImageProcessorFast
although it was already implemented. For resolving that issue, this PR builds test module forViTImageProcessorFast
Related Issue/PR: #36978
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
cc @amyeroberts, @qubvel