-
Notifications
You must be signed in to change notification settings - Fork 31.5k
[WIP] Add DINO DETR Model to HuggingFace Transformers #36711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Hello @qubvel! The state of the PR is that I've gotten the forward pass to match the original implementation up to the required precision. I've marked this as a draft because I wanted to just get a first opinion on if I'm modifying the correct files in the codebase. Let me know if I'm missing anything big. Regarding tests, i've copied some from Deformable Detr but haven't tried getting them to work. Let me know if I need to add any apart from what's already there. |
|
Hi @konstantinos-p! Thanks a lot for working on the model, super excited to see it merged! 🚀 Before diving into the implementation details, here are some general comments we need to address in the PR:
Thanks again! Looking forward to the updates 🚀 |
|
Thanks for the comments! I'll start addressing them! |
|
Hello @qubvel I'm facing a similar issue to this one. Basically I'm rewriting the model to use modular but instead of DinoDetr Dino get's captured by the compiler as the model name. Is there a fix for this? Alternatively I could apply modular only on the processor. @Cyrilvallez was mentioned as possibly having faced something similar. |
|
Yes, see my answer here #36895 (comment)! |
4177040 to
dd47744
Compare
|
@Cyrilvallez thanks for the fix, it seems to work for me! |
|
Hello @qubvel ! I've addressed your initial comments, I've added tests which pass + a first draft of docs etc. I think it would be a good time to have a second look! CircleCI tests were passing as well but now are failing after I rebased on recent changes. I'll need some help with these as well! |
|
Hello @qubvel! It would be great if we could make a final push and merge this! I'd rather work on it while the key points are still fresh. DINO Detr is still very competitive and an important model in the Detr line on top of which one could create new architectures. |
|
Hey @konstantinos-p , I will be taking a look at your PR now! First of all, I'm seeing a few git pull main
git merge main
pip install -e .[quality]and for the |
molbap
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did an initial review and tried to leave pointers for modular, when it is not possible to inherit from another model let's try and stay aligned with existing methods! Feel free to ping me when you've had time to update the branch and adress initial comments 🤗
5350f8f to
50f5be3
Compare
|
@konstantinos-p can you merge |
Hello @molbap ! Sounds good! I've been doing fetch/rebase main. (Not really familiar with the finer differences between rebase/merge) What is the difference with doing merge? (Also could you elaborate a bit on the yanked part :) ) I've addressed the comments as far as I can tell and also did another passthrough over the modular/modeling code to add some comments/cleanup. I guess you can have a second look! |
|
Hey @konstantinos-p, are you sure you've rebased on origin:main? merge or rebase make no difference here as we'll squash in the end, but the taking another look now :) |
|
I'll have a look at the rebase! Btw, I tried using the SinePositionEmbedding from deformable detr but unfortunately it doesn't exactly match as far as I can tell. Although I think I can use LearnedPositionEmbedding as is. I've also removed alot of the original config parameters. I did this by looking at the original repo and checking if they change with any configs for other variants of the model (I also used my own judgement). I think it might be possible to also remove the |
|
Regarding the rebase: I see for example that my commit history on this branch includes from two weeks ago, because I rebased then. At that time I ran I see also that the test_modeling_common.py keeps having conflicts even though I ran |
b92534e to
9e97174
Compare
…_without_tied_weights
bac42cb to
5a3fec3
Compare
|
[For maintainers] Suggested jobs to run (before merge) run-slow: auto, dino_detr |
|
View the CircleCI Test Summary for this PR: https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=36711&sha=5a3fec |

What does this PR do?
This PR introduces the DINO DETR (DEtection TRansformer with DIstillation) model (https://arxiv.org/abs/2203.03605) to the Hugging Face Transformers library. DINO DETR is a state-of-the-art object detection model that builds upon the original DETR architecture, incorporating improvements such as:
The model achieves strong performance on COCO test-dev (https://paperswithcode.com/sota/object-detection-on-coco).
Fixes #36205
What's included
Resources I've used
Who can review?
@amyeroberts, @qubvel