Skip to content

Refactor DAB-DETR in MMDetection 3.x #9252

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

Merged
merged 49 commits into from
Dec 22, 2022

Conversation

KeiChiTse
Copy link
Contributor

Motivation

This PR resolves several confilcits and rearrange the code structure based on PR #8811. Comparing to PR #8533 for 2.x, this PR aims to refactor DAB-DETR in MMDetection 3.x.

I'm working together with @jshilong, @Li-Qingyun, and @LYMDLUT to refactor the DETR-like algorithms in MMDetection 3.x, using a more lightweight and easy-to-read code style.

Details can be refered to in brother PRs #9149, #8362, #8763, #8544, #9248, feel free to contact me and give your advice!

@jshilong jshilong assigned jshilong and unassigned ZwwWayne Nov 7, 2022
@jshilong jshilong self-requested a review November 7, 2022 02:21
@JosonChan1998
Copy link
Contributor

Hi !@KeiChiTse, any plans about Anchor DETR?

@LYMDLUT
Copy link
Contributor

LYMDLUT commented Nov 8, 2022

Hi !@KeiChiTse, any plans about Anchor DETR?

Hi,thank you for your attention,we will fisrt support Condational DETR、DAB DETR and DINO,then Group DETR and deformable dab is at second position. Now we have met some difficulty to align with original repo, we will try our best.As Row-Column Attention is not commonly used,we may not officially support it at very soon.

@JosonChan1998
Copy link
Contributor

Hi !@KeiChiTse, any plans about Anchor DETR?

Hi,thank you for your attention,we will fisrt support Condational DETR、DAB DETR and DINO,then Group DETR and deformable dab is at second position. Now we have met some difficulty to align with original repo, we will try our best.As Row-Column Attention is not commonly used,we may not officially support it at very soon.

Thanks for your reply!

@KeiChiTse
Copy link
Contributor Author

[Update]

Fixed error after refactoring and finished aligning loss and inference results compared to 2.x version! The code is ready for training.
More refactored detr-like algorithms are on the way!

@KeiChiTse
Copy link
Contributor Author

Hi !@KeiChiTse, any plans about Anchor DETR?

Hi,thank you for your attention,we will fisrt support Condational DETR、DAB DETR and DINO,then Group DETR and deformable dab is at second position. Now we have met some difficulty to align with original repo, we will try our best.As Row-Column Attention is not commonly used,we may not officially support it at very soon.

Thanks for your reply!

Guess my partner had done his job haha. Thank you anyway!

@ZwwWayne ZwwWayne added this to the 3.0.0rc5 milestone Nov 21, 2022
@jshilong
Copy link
Collaborator

Please merge the refactor-detr first and resolve all conflicts

@KeiChiTse KeiChiTse force-pushed the refactor-dab-detr-3.x branch from b2c5339 to d11d684 Compare December 19, 2022 07:53
@jshilong
Copy link
Collaborator

LGTM

Copy link
Collaborator

@jshilong jshilong left a comment

Choose a reason for hiding this comment

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

LGTM

@KeiChiTse
Copy link
Contributor Author

[Update]

Ready to be merged...

@ZwwWayne ZwwWayne merged commit d170810 into open-mmlab:refactor-detr Dec 22, 2022
jshilong pushed a commit that referenced this pull request Jan 19, 2023
* resolve refactor conflict w.o. pre-commit hooks

* fixed error and finished alignment

* supprot 91 cls and remove batch_first

* delete iter_update, keep return intermediate

* delete posHW

* substitute 'num_query' to 'num_queries'

* change 'gen_sineembed_for_position' to 'convert_coordinate_to_encoding'

* resolve extra comments

* fix error

* fix error

* fix data path

* support 91 cls temporarily

* resolve extra comments

* fix num_keys, num_feats

* delete reg_branches in decoder_inputs_dict

* fix docstring

* fix docstring

* commit modification in pr of DINO

* fix data format from nbc to bnc in detr and deformable-detr

* fix 'gen_encoder_output_proposals' for two-stage deformable-detr

* fix 'gen_encoder_output_proposals' for two-stage deformable-detr

* set 'batch_first' to True in deformable attention

* fix error

* fix ut

* add assert for batch_first

* remove 91 cls

* modify pre_decoder of DeformableDETR

* delete useless comments

* bnc data flow w.o. merge detr and def-detr

* assert batch first flag in conditional attention, fix error

* add unit test for dab-detr

* fix doc

* disable yapf hook

* move conditional attention to trm/layers

* fix name and add doc

* fix doc

* add loss_and_predict for head

* fix doc and typehint

* fix doc and typehint

* modify batch first assert for attention

* change Dab to DAB

* rename file and function

* make dab-detr head inherit conditional detr head

* fix doc

* fix doc

Co-authored-by: QingyunLi <[email protected]>
yumion pushed a commit to yumion/mmdetection that referenced this pull request Jan 31, 2024
* resolve refactor conflict w.o. pre-commit hooks

* fixed error and finished alignment

* supprot 91 cls and remove batch_first

* delete iter_update, keep return intermediate

* delete posHW

* substitute 'num_query' to 'num_queries'

* change 'gen_sineembed_for_position' to 'convert_coordinate_to_encoding'

* resolve extra comments

* fix error

* fix error

* fix data path

* support 91 cls temporarily

* resolve extra comments

* fix num_keys, num_feats

* delete reg_branches in decoder_inputs_dict

* fix docstring

* fix docstring

* commit modification in pr of DINO

* fix data format from nbc to bnc in detr and deformable-detr

* fix 'gen_encoder_output_proposals' for two-stage deformable-detr

* fix 'gen_encoder_output_proposals' for two-stage deformable-detr

* set 'batch_first' to True in deformable attention

* fix error

* fix ut

* add assert for batch_first

* remove 91 cls

* modify pre_decoder of DeformableDETR

* delete useless comments

* bnc data flow w.o. merge detr and def-detr

* assert batch first flag in conditional attention, fix error

* add unit test for dab-detr

* fix doc

* disable yapf hook

* move conditional attention to trm/layers

* fix name and add doc

* fix doc

* add loss_and_predict for head

* fix doc and typehint

* fix doc and typehint

* modify batch first assert for attention

* change Dab to DAB

* rename file and function

* make dab-detr head inherit conditional detr head

* fix doc

* fix doc

Co-authored-by: QingyunLi <[email protected]>
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.

6 participants