This commit is contained in:
Glenn Jocher 2019-08-15 16:11:34 +02:00
parent c4cc95bdbd
commit 4f78eec83e
1 changed files with 2 additions and 2 deletions

View File

@ -583,9 +583,9 @@ def kmeans_targets(path='data/coco_64img.txt', n=9, img_size=416): # from utils
# Get label wh
dataset = LoadImagesAndLabels(path, augment=True, rect=True)
for s, l in zip(dataset.shapes, dataset.labels):
l[:, [1, 3]] *= s[0]
l[:, [1, 3]] *= s[0] # normalized to pixels
l[:, [2, 4]] *= s[1]
l[:, 1:] *= img_size / max(s) # nominal img_size for training here
l[:, 1:] *= img_size / max(s) # nominal img_size for training
wh = np.concatenate(dataset.labels, 0)[:, 3:5] # wh from cxywh
# Kmeans calculation