transformers
846bdfdd - Fix D-FINE / RT-DETR main loss being computed over the denoising queries (#48528)

Commit
5 days ago
Fix D-FINE / RT-DETR main loss being computed over the denoising queries (#48528) * Fix D-FINE / RT-DETR main loss being computed over the denoising queries `DFineForObjectDetectionLoss` and `RTDetrForObjectDetectionLoss` (also used by RT-DETRv2) built the main, Hungarian-matched loss term from the last decoder layer's `logits` / `pred_boxes` over all queries. During training with `num_denoising > 0` these tensors contain the contrastive denoising queries in front of the normal queries; they were only split off for the auxiliary and `dn_*` terms. As the positive denoising queries start next to the ground truth, the matcher assigned most targets to them and the normal queries of the inference layer received almost no positive supervision. Split the denoising queries off the main term as the reference implementations do, and add regression tests for D-FINE and RT-DETR. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix: apply review suggestion Co-authored-by: guarin <43336610+guarin@users.noreply.github.com> * fix: apply suggestions from review * docs: add reference to PR in loss comments and regression tests --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: guarin <43336610+guarin@users.noreply.github.com>
Author
Parents
Loading