Skip to content

Commit 88e24bf

Browse files
authored
[Fix] RT-DETR SSOD iou_score (#8409)
1 parent 02f5886 commit 88e24bf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ppdet/modeling/losses/detr_loss.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -325,15 +325,15 @@ def _get_prediction_loss(self,
325325
match_indices = dn_match_indices
326326

327327
if self.use_vfl:
328-
if sum(len(a) for a in gt_bbox) > 0:
328+
if gt_score is not None: #ssod
329+
_, target_score = self._get_src_target_assign(
330+
logits[-1].detach(), gt_score, match_indices)
331+
elif sum(len(a) for a in gt_bbox) > 0:
329332
src_bbox, target_bbox = self._get_src_target_assign(
330333
boxes.detach(), gt_bbox, match_indices)
331334
iou_score = bbox_iou(
332335
bbox_cxcywh_to_xyxy(src_bbox).split(4, -1),
333336
bbox_cxcywh_to_xyxy(target_bbox).split(4, -1))
334-
if gt_score is not None: #ssod
335-
_, target_score = self._get_src_target_assign(
336-
logits[-1].detach(), gt_score, match_indices)
337337
else:
338338
iou_score = None
339339
else:

0 commit comments

Comments
 (0)