Skip to content

Add DEIMv2 model, image processor, and basic tests#41356

Open
Vinayaktoor wants to merge 4 commits intohuggingface:mainfrom
Vinayaktoor:adding-DEIMv2-model
Open

Add DEIMv2 model, image processor, and basic tests#41356
Vinayaktoor wants to merge 4 commits intohuggingface:mainfrom
Vinayaktoor:adding-DEIMv2-model

Conversation

@Vinayaktoor
Copy link
Copy Markdown

@Vinayaktoor Vinayaktoor commented Oct 5, 2025

What does this PR do?

This PR introduces the DEIMv2 model along with its configuration, image processor, and unit tests. The changes include:

Model Implementation: Added Deimv2ForObjectDetection supporting object detection tasks.

Configuration: Added Deimv2Config for model hyperparameters.

Image Processing: Added Deimv2ImageProcessor to handle preprocessing and postprocessing of images.

Unit Tests: Added tests for configuration, image processing, and model forward pass (tests/models/deimv2/).

This PR builds upon and makes changes to PR by @kekwlboy12469, PR #41291.
Fixes #41211
Fixes missing or incomplete DEIMv2 model integration.

Fixes absence of unit tests for DEIMv2 model and image processor.

Fixes compatibility issues with Transformers pipelines for object detection.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@Rocketknight1
Copy link
Copy Markdown
Member

Rocketknight1 commented Oct 6, 2025

cc @NielsRogge @yonigozlan

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 7, 2025

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

run-slow: deimv2

@peacefulotter
Copy link
Copy Markdown

Hi,

Is there still a will to merge this PR at some point ?

I think the implementation is unfinished yet; DEIMV2_PRESETS defines dinov2 as backbone instead of dinov3 and the published model.safetensors doesn't align with the proposed model anyway.

Best

@Rocketknight1
Copy link
Copy Markdown
Member

gentle ping @molbap @NielsRogge @McPatate if anyone wants to take it!

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.

Add DEIMv2

3 participants