This commit is contained in:
Glenn Jocher 2020-01-02 11:11:45 -08:00
parent e0e8b7173c
commit 0b242a438b
1 changed files with 1 additions and 1 deletions

View File

@ -755,7 +755,7 @@ def kmean_anchors(path='data/coco64.txt', n=9, img_size=(320, 640)):
wh *= np.random.uniform(img_size[0], img_size[1], size=(wh.shape[0], 1)) # normalized to pixels (multi-scale) wh *= np.random.uniform(img_size[0], img_size[1], size=(wh.shape[0], 1)) # normalized to pixels (multi-scale)
# Kmeans calculation # Kmeans calculation
print('Running kmeans on %g boxes...' % len(wh)) print('Running kmeans on %g points...' % len(wh))
s = wh.std(0) # sigmas for whitening s = wh.std(0) # sigmas for whitening
k, dist = kmeans(wh / s, n, iter=30) # points, mean distance k, dist = kmeans(wh / s, n, iter=30) # points, mean distance
k = k[np.argsort(k.prod(1))] * s # sort small to large k = k[np.argsort(k.prod(1))] * s # sort small to large