This commit is contained in:
Glenn Jocher
2019-08-17 17:10:57 +02:00
parent b72fb74ad0
commit 926447e8c4
2 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ def labels_to_class_weights(labels, nc=80):
# Prepend gridpoint count (for uCE trianing)
# gpi = ((320 / 32 * np.array([1, 2, 4])) ** 2 * 3).sum() # gridpoints per image
# weights = np.hstack([gpi * ni, weights]) # prepend gridpoints to start
# weights = np.hstack([gpi * ni - weights.sum() * 9, weights * 9]) ** 0.5 # prepend gridpoints to start
weights[weights == 0] = 1 # replace empty bins with 1
weights = 1 / weights # number of targets per class