Skip to content

Fix MobileNet v1/v2 image processor default interpolation to BICUBIC#43313

Open
VedantMadane wants to merge 1 commit intohuggingface:mainfrom
VedantMadane:fix/mobilenet-interpolation-bicubic
Open

Fix MobileNet v1/v2 image processor default interpolation to BICUBIC#43313
VedantMadane wants to merge 1 commit intohuggingface:mainfrom
VedantMadane:fix/mobilenet-interpolation-bicubic

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

@Rocketknight1
Copy link
Member

cc @NielsRogge if that issue is still relevant! If not we should close it, since I think a lot of people and code agents are searching for old open issues lately

@VedantMadane VedantMadane force-pushed the fix/mobilenet-interpolation-bicubic branch from 96e6dbc to 73d24bc Compare January 26, 2026 08:29
@VedantMadane VedantMadane force-pushed the fix/mobilenet-interpolation-bicubic branch from 73d24bc to 040019f Compare February 10, 2026 16:54
@VedantMadane VedantMadane force-pushed the fix/mobilenet-interpolation-bicubic branch from 040019f to fcc2582 Compare February 10, 2026 18:00
@github-actions
Copy link
Contributor

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

run-slow: mobilenet_v1, mobilenet_v2

@VedantMadane
Copy link
Author

Kindly approve the two checks so that they can run.

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.

2 participants