Skip to content
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

[WIP][DiffusionDet] Diffusion models for object detection #10238

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

HichTala
Copy link

This pull request introduces a new model, DiffusionDet, and its associated components. The changes include the addition of configuration, head, loss, and model files, as well as a temporary debug script to test the model.
This is a first draft, nothing ready to use right now, I am creating this PR to get some feedback as it is my first time.

Key changes:

New Model Addition:

Configuration:

Head Implementation:

Loss Computation:

  • src/diffusers/models/diffusiondet/loss.py: Added the DynamicCriterion class to compute the loss for the DiffusionDet model, including the process for Hungarian assignment and supervision of matched pairs.

Debug Script:

  • debug_diffusiondet.py: Added a script to create and test the DiffusionDet model using the configuration and model classes.# What does this PR do?

Fixes # (issue)

Before submitting

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.

@patrickvonplaten and @ShoufaChen participated in the previous implementation trial.

@HichTala HichTala marked this pull request as draft December 16, 2024 10:21
@HichTala
Copy link
Author

The original model uses lists of detectron Bbox objects, I am adapting the code to use classical pytorch tensor with shape (B, N, 4) (B: batch size, N: number of proposals)

@yiyixuxu
Copy link
Collaborator

hi @HichTala thanks for the PR, the model is a bit of out dated at this point I think
do you want to try to see if we can make it work with remote_code? https://huggingface.co/docs/diffusers/using-diffusers/custom_pipeline_overview#community-components

@HichTala
Copy link
Author

Hi @yiyixuxu,
Thank you for the suggestion! I’m happy to explore making it work with remote_code. My main goal is to contribute to the community, and Hugging Face is a great platform to share this work. I’m open to following whatever approach the main contributors believe is the best way to share it. Let me know how we can proceed!

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