This commit is contained in:
Glenn Jocher 2020-01-02 10:03:22 -08:00
parent 23288236a6
commit 8841c4980c
1 changed files with 1 additions and 1 deletions

View File

@ -770,7 +770,7 @@ def kmean_anchors(path='data/coco64.txt', n=12, img_size=(320, 640)):
iou = wh_iou(torch.Tensor(wh), torch.Tensor(k)) iou = wh_iou(torch.Tensor(wh), torch.Tensor(k))
min_iou, max_iou = iou.min(1)[0], iou.max(1)[0] min_iou, max_iou = iou.min(1)[0], iou.max(1)[0]
for x in [0.10, 0.15, 0.20, 0.25, 0.30, 0.35]: # iou thresholds for x in [0.10, 0.15, 0.20, 0.25, 0.30, 0.35]: # iou thresholds
print('%.2f iou_thr: %.3f best possible recall, %.3f anchors > thr' % print('%.2f iou_thr: %.3f best possible recall, %.1f anchors > thr' %
(x, (max_iou > x).float().mean(), (iou > x).float().mean() * n)) # BPR (best possible recall) (x, (max_iou > x).float().mean(), (iou > x).float().mean() * n)) # BPR (best possible recall)
# Print # Print