Skip to content

Conversation

@ammarjmahmood
Copy link

What does this PR do?

Fixes the default interpolation method for EfficientNet image processor from NEAREST to BICUBIC to match the original TensorFlow implementation.

Motivation

As pointed out in #28180 to check the models in the list, the EfficientNet image processor was using NEAREST interpolation , but the original TensorFlow implementation uses BICUBIC by default.

The _resize_image() function in the original code explicitly uses tf.image.resize_bicubic as the default resize method.

Changes

  • Changed default resample parameter from PIL.Image.NEAREST to PILImageResampling.BICUBIC
  • All related docstrings (lines 69, 136, 154)

Fixes #28180 (partial - for EfficientNet model)


Before submitting

cc @yonigozlan @molbap (vision models reviewers)

…ntation in the code

Original method --> Bicubic\
Source: tpu/models/official/efficientnet/preprocessing.py
	Function def _resize_image() Line 88
- Changed default resample from Nearest to BICUBIC
- Original Tensorflow implementation uses resize_bicubic by default in original code
- Fixes Issue huggingface#28180
- Reorder imports in metaclip_2 conversion script to satisfy ruff formatter
- Remove -> None annotation from EfficientNetImageProcessor.__init__ to match docstring checker expectations
@github-actions
Copy link
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: efficientnet, metaclip_2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verify interpolation of image processors

1 participant