Skip to content

🚨Fix default interpolation for PVT to match original implementation (Bicubic)#43017

Merged
yonigozlan merged 6 commits intohuggingface:mainfrom
Arpit2744:fix-pvt-interpolation
Jan 22, 2026
Merged

🚨Fix default interpolation for PVT to match original implementation (Bicubic)#43017
yonigozlan merged 6 commits intohuggingface:mainfrom
Arpit2744:fix-pvt-interpolation

Conversation

@Arpit2744
Copy link
Copy Markdown
Contributor

@Arpit2744 Arpit2744 commented Dec 23, 2025

What does this PR do?

This PR updates the default interpolation method for PvtImageProcessor (both standard and fast versions) from BILINEAR to BICUBIC.

Motivation

The original PVT implementation follows the DeiT training recipe, which relies on Bicubic interpolation.
Additionally, the timm library (the standard reference for this model) uses interpolation='bicubic' for all PVT variants.
Vision Transformers generally require Bicubic interpolation to preserve high-frequency details during patch embedding.

Checklist

  • I have updated the interpolation to PILImageResampling.BICUBIC.

@Arpit2744
Copy link
Copy Markdown
Contributor Author

Ready for review! I have updated the interpolation to BICUBIC to match the original implementation. I also removed the 'Copied from' tag since the implementation now differs from VIT All 18 CI tests are passing.

@Rocketknight1
Copy link
Copy Markdown
Member

cc @molbap @yonigozlan

Copy link
Copy Markdown
Member

@yonigozlan yonigozlan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Happy to merge this

@yonigozlan yonigozlan changed the title Fix default interpolation for PVT to match original implementation (Bicubic) 🚨Fix default interpolation for PVT to match original implementation (Bicubic) Jan 22, 2026
@yonigozlan yonigozlan enabled auto-merge (squash) January 22, 2026 18:17
@github-actions
Copy link
Copy Markdown
Contributor

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

run-slow: pvt

@yonigozlan yonigozlan merged commit ef2de73 into huggingface:main Jan 22, 2026
20 checks passed
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

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.

SangbumChoi pushed a commit to SangbumChoi/transformers that referenced this pull request Jan 23, 2026
…Bicubic) (huggingface#43017)

* Fix default interpolation for PVT (Fast and Python) to BICUBIC

* Polish code and trigger CI restart

* Fix docstring to match PILImageResampling.BICUBIC

* Remove Copied from tag and finalize BICUBIC fix

* Apply make style after removing comment

---------

Co-authored-by: yonigozlan <yoni.gozlan@huggingface.co>
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.

4 participants