IDEA-Research / DAB-DETR

[ICLR 2022] Official implementation of the paper "DAB-DETR: Dynamic Anchor Boxes are Better Queries for DETR"
Apache License 2.0
517 stars 87 forks source link

Why does the model predict bbox offset twice? #24

Closed LiewFeng closed 2 years ago

LiewFeng commented 2 years ago

The model predicts bbox offsets twice, in [DAB-DETR/blob/main/models/DAB_DETR/transformer.py, Line 255-265](https://github.com/IDEA-opensource/DAB-DETR/blob/main/models/DAB_DETR/transformer.py#:~:text=if%20self.bbox_embed,reference_points%20%3D%20new_reference_points.detach()), in DAB-DETR/blob/main/models/DAB_DETR/DABDETR.py, Line 171-184. The difference is that the input of the second predict is normed. The second predict seems unnecessary. Am I right?

SlongLiu commented 2 years ago

Our implementations work better than predicting bbox offset once only in our experiments.

LiewFeng commented 2 years ago

Thank you for your quick reply! Could you kindly provide the detailed performance? I'm interested in it since an intuition is that normalized input would work better.

SlongLiu commented 2 years ago

Both updates work in unnormalized space. The main difference is the detach() operation, which may affect the performance.

LiewFeng commented 2 years ago

Got. Thanks!