This commit is contained in:
Glenn Jocher 2019-09-11 21:24:22 +02:00
parent 806d7b92d8
commit a1b50aaa43
3 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,4 @@
import argparse import argparse
import time
from sys import platform from sys import platform
from models import * # set ONNX_EXPORT in models.py from models import * # set ONNX_EXPORT in models.py

View File

@ -430,7 +430,7 @@ if __name__ == '__main__':
# Mutate # Mutate
init_seeds(seed=int(time.time())) init_seeds(seed=int(time.time()))
s = [.15, .15, .15, .15, .15, .15, .15, .00, .02, .20, .15, .0, .0, .0, .0, .0, .0] # sigmas s = [.15, .15, .15, .15, .15, .15, .15, .00, .02, .20, .20, .20, .20, .20, .20, .20, .20] # sigmas
for i, k in enumerate(hyp.keys()): for i, k in enumerate(hyp.keys()):
x = (np.random.randn(1) * s[i] + 1) ** 2.0 # plt.hist(x.ravel(), 300) x = (np.random.randn(1) * s[i] + 1) ** 2.0 # plt.hist(x.ravel(), 300)
hyp[k] *= float(x) # vary by sigmas hyp[k] *= float(x) # vary by sigmas

View File

@ -88,6 +88,9 @@ def coco_class_weights(): # frequency of each class in coco train2014
1877, 17630, 4337, 4624, 1075, 3468, 135, 1380] 1877, 17630, 4337, 4624, 1075, 3468, 135, 1380]
weights = 1 / torch.Tensor(n) weights = 1 / torch.Tensor(n)
weights /= weights.sum() weights /= weights.sum()
# with open('data/coco.names', 'r') as f:
# for k, v in zip(f.read().splitlines(), n):
# print('%20s: %g' % (k, v))
return weights return weights