transformers/tests/models/efficientnet
Zeeshan Khan Suri a7d2bbaaa8
Add EfficientNet Image PreProcessor (#37055)
* added efficientnet image preprocessor but tests fail

* ruff checks pass

* ruff formatted

* properly pass rescale_offset through the functions

* - corrected indentation, ordering of methods
- reshape test passes when casted to float64
- equivalence test doesn't pass

* all tests now pass
- changes order of rescale, normalize acc to slow
- rescale_offset defaults to False acc to slow
- resample was causing difference in fast and slow. Changing test to bilinear resolves this difference

* ruff reformat

* F.InterpolationMode.NEAREST_EXACT gives TypeError: Object of type InterpolationMode is not JSON serializable

* fixes offset not being applied when do_rescale and do_normalization are both true

* - using nearest_exact sampling
- added tests for rescale + normalize

* resolving reviews

---------

Co-authored-by: Yoni Gozlan <74535834+yonigozlan@users.noreply.github.com>
2025-04-16 21:59:24 +02:00
..
__init__.py Add EfficientNet (#21563) 2023-02-20 16:37:11 +03:00
test_image_processing_efficientnet.py Add EfficientNet Image PreProcessor (#37055) 2025-04-16 21:59:24 +02:00
test_modeling_efficientnet.py Use Python 3.9 syntax in tests (#37343) 2025-04-08 14:12:08 +02:00