developer0hye commited on
Commit
0588424
·
1 Parent(s): 3f5e7de

perf(head): faster computation to find overlapped anchor (#1473)

Browse files
Files changed (1) hide show
  1. yolox/models/yolo_head.py +1 -1
yolox/models/yolo_head.py CHANGED
@@ -630,7 +630,7 @@ class YOLOXHead(nn.Module):
630
  del topk_ious, dynamic_ks, pos_idx
631
 
632
  anchor_matching_gt = matching_matrix.sum(0)
633
- if (anchor_matching_gt > 1).sum() > 0:
634
  _, cost_argmin = torch.min(cost[:, anchor_matching_gt > 1], dim=0)
635
  matching_matrix[:, anchor_matching_gt > 1] *= 0
636
  matching_matrix[cost_argmin, anchor_matching_gt > 1] = 1
 
630
  del topk_ious, dynamic_ks, pos_idx
631
 
632
  anchor_matching_gt = matching_matrix.sum(0)
633
+ if anchor_matching_gt.max() > 1:
634
  _, cost_argmin = torch.min(cost[:, anchor_matching_gt > 1], dim=0)
635
  matching_matrix[:, anchor_matching_gt > 1] *= 0
636
  matching_matrix[cost_argmin, anchor_matching_gt > 1] = 1