Skip to content

Commit

Permalink
[Fix] RT-DETR SSOD iou_score (#8409)
Browse files Browse the repository at this point in the history
  • Loading branch information
nijkah authored Jul 13, 2023
1 parent 02f5886 commit 88e24bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ppdet/modeling/losses/detr_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,15 @@ def _get_prediction_loss(self,
match_indices = dn_match_indices

if self.use_vfl:
if sum(len(a) for a in gt_bbox) > 0:
if gt_score is not None: #ssod
_, target_score = self._get_src_target_assign(
logits[-1].detach(), gt_score, match_indices)
elif sum(len(a) for a in gt_bbox) > 0:
src_bbox, target_bbox = self._get_src_target_assign(
boxes.detach(), gt_bbox, match_indices)
iou_score = bbox_iou(
bbox_cxcywh_to_xyxy(src_bbox).split(4, -1),
bbox_cxcywh_to_xyxy(target_bbox).split(4, -1))
if gt_score is not None: #ssod
_, target_score = self._get_src_target_assign(
logits[-1].detach(), gt_score, match_indices)
else:
iou_score = None
else:
Expand Down

0 comments on commit 88e24bf

Please sign in to comment.