Skip to content

Commit a4152a5

Browse files
perf(head): faster computation to find overlapped anchor (Megvii-BaseDetection#1473)
1 parent dbb4efb commit a4152a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

yolox/models/yolo_head.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ def dynamic_k_matching(self, cost, pair_wise_ious, gt_classes, num_gt, fg_mask):
630630
del topk_ious, dynamic_ks, pos_idx
631631

632632
anchor_matching_gt = matching_matrix.sum(0)
633-
if (anchor_matching_gt > 1).sum() > 0:
633+
if anchor_matching_gt.max() > 1:
634634
_, cost_argmin = torch.min(cost[:, anchor_matching_gt > 1], dim=0)
635635
matching_matrix[:, anchor_matching_gt > 1] *= 0
636636
matching_matrix[cost_argmin, anchor_matching_gt > 1] = 1

0 commit comments

Comments
 (0)