Commit
·
ef75f73
1
Parent(s):
2daa412
AutoAnchor n, imgsz bug fix
Browse files- utils/utils.py +1 -1
utils/utils.py
CHANGED
@@ -69,7 +69,7 @@ def check_anchors(dataset, model, thr=4.0, imgsz=640):
|
|
69 |
print('Best Possible Recall (BPR) = %.4f' % bpr, end='')
|
70 |
if bpr < 0.99: # threshold to recompute
|
71 |
print('. Attempting to generate improved anchors, please wait...' % bpr)
|
72 |
-
new_anchors = kmean_anchors(dataset, n=
|
73 |
new_bpr = metric(new_anchors.reshape(-1, 2))
|
74 |
if new_bpr > bpr:
|
75 |
anchors[:] = torch.tensor(new_anchors).view_as(anchors).type_as(anchors)
|
|
|
69 |
print('Best Possible Recall (BPR) = %.4f' % bpr, end='')
|
70 |
if bpr < 0.99: # threshold to recompute
|
71 |
print('. Attempting to generate improved anchors, please wait...' % bpr)
|
72 |
+
new_anchors = kmean_anchors(dataset, n=anchors.numel() // 2, img_size=imgsz, thr=thr, gen=1000, verbose=False)
|
73 |
new_bpr = metric(new_anchors.reshape(-1, 2))
|
74 |
if new_bpr > bpr:
|
75 |
anchors[:] = torch.tensor(new_anchors).view_as(anchors).type_as(anchors)
|