Commit
·
0588424
1
Parent(s):
3f5e7de
perf(head): faster computation to find overlapped anchor (#1473)
Browse files
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
|
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
|