From 398f8eadec34f814fa0eb43fb4f7120a568b1bc7 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Fri, 10 Apr 2020 16:34:32 -0700 Subject: [PATCH] add thr=0.10 to kmean_anchors() --- utils/utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/utils.py b/utils/utils.py index 4a1a07ab..ab121c64 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -688,11 +688,12 @@ def coco_single_class_labels(path='../coco/labels/train2014/', label_class=43): shutil.copyfile(src=img_file, dst='new/images/' + Path(file).name.replace('txt', 'jpg')) # copy images -def kmean_anchors(path='../coco/train2017.txt', n=12, img_size=(320, 1024)): - # from utils.utils import *; _ = kmean_anchors() - # Creaters kmeans anchors for use in *.cfg files +def kmean_anchors(path='../coco/train2017.txt', n=12, img_size=(320, 1024), thr=0.10): + # Creates kmeans anchors for use in *.cfg files: from utils.utils import *; _ = kmean_anchors() + # n: number of anchors + # img_size: (min, max) image size used for multi-scale training (can be same values) + # thr: IoU threshold hyperparameter used for training (0.0 - 1.0) from utils.datasets import LoadImagesAndLabels - thr = 0.225 # IoU threshold def print_results(k): k = k[np.argsort(k.prod(1))] # sort small to large