Atten4Vis / MS-DETR

[CVPR 2024] The official implementation for "MS-DETR: Efficient DETR Training with Mixed Supervision"
Apache License 2.0
81 stars 5 forks source link

Question about o2m matcher? #3

Open chenzyhust opened 8 months ago

chenzyhust commented 8 months ago

o2m matcher can guarante that each GT will have at least 1 prediction matching?

ZhaoChuyang commented 8 months ago

Hi, it cannot, but this case is rare. The o2m matcher initially computes the matching score between all GTs and all predictions, then assigns each prediction to the GT with the highest score (if the score is above the threshold). When a GT has no predictions with a matching score above the threshold, the matcher assigns the prediction with the highest score to it. This is controlled by the allow_low_quality_matches parameter in Matcher (in matcher_o2m.py), which is set to True by default.

However, there are cases where a GT A has no matched predictions, and the prediction p with the highest score to it is assigned to a different GT B. In this scenario, prediction p remains assigned to B, leaving GT A without any matched predictions.

yuanqianguang commented 3 months ago

Hi, it cannot, but this case is rare. The o2m matcher initially computes the matching score between all GTs and all predictions, then assigns each prediction to the GT with the highest score (if the score is above the threshold). When a GT has no predictions with a matching score above the threshold, the matcher assigns the prediction with the highest score to it. This is controlled by the allow_low_quality_matches parameter in Matcher (in matcher_o2m.py), which is set to True by default.

However, there are cases where a GT A has no matched predictions, and the prediction p with the highest score to it is assigned to a different GT B. In this scenario, prediction p remains assigned to B, leaving GT A without any matched predictions.

How to compute the loss of GT A in this condition? ignoring or any other operation?

ZhaoChuyang commented 3 months ago

Hi, it cannot, but this case is rare. The o2m matcher initially computes the matching score between all GTs and all predictions, then assigns each prediction to the GT with the highest score (if the score is above the threshold). When a GT has no predictions with a matching score above the threshold, the matcher assigns the prediction with the highest score to it. This is controlled by the allow_low_quality_matches parameter in Matcher (in matcher_o2m.py), which is set to True by default. However, there are cases where a GT A has no matched predictions, and the prediction p with the highest score to it is assigned to a different GT B. In this scenario, prediction p remains assigned to B, leaving GT A without any matched predictions.

How to compute the loss of GT A in this condition? ignoring or any other operation?

Hi, in this case, the loss of GT A is ignoring, treating as the case where no predictions are matched for GT A.

yuanqianguang commented 3 months ago

Thks so much ^_^