Skip to content

Conversation

@VedantMadane
Copy link

Summary

Fix the default interpolation method for MobileNet v1 and v2 image processors from BILINEAR to BICUBIC, matching the original timm implementation.

Motivation

As part of #28180, we need to verify that image processor interpolation methods match their original implementations. The MobileNet models in timm use BICUBIC interpolation for preprocessing, but the transformers image processors were defaulting to BILINEAR.

Changes

  • mobilenet_v1/image_processing_mobilenet_v1.py: Changed default resample from PILImageResampling.BILINEAR to PILImageResampling.BICUBIC
  • mobilenet_v2/image_processing_mobilenet_v2.py: Changed default resample from PILImageResampling.BILINEAR to PILImageResampling.BICUBIC

Verification

The timm documentation confirms MobileNet models use bicubic interpolation:

Contributes to #28180

The MobileNet image processors were defaulting to BILINEAR interpolation, but the original timm implementation uses BICUBIC. This change aligns transformers with timm's preprocessing.

Contributes to huggingface#28180
@github-actions
Copy link
Contributor

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

run-slow: mobilenet_v1, mobilenet_v2

@github-actions
Copy link
Contributor

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=43313&sha=57bfe6

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.

1 participant