From 9c6b6968ba7819efeee23229f14e972e32126ef6 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Wed, 21 Aug 2019 00:27:11 +0200 Subject: [PATCH] updates --- utils/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/utils.py b/utils/utils.py index 2454485c..c5272766 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -62,8 +62,8 @@ def labels_to_class_weights(labels, nc=80): weights = np.bincount(classes, minlength=nc) # occurences per class # 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.sum() * 9, weights * 9]) ** 0.5 # prepend gridpoints to start + gpi = ((320 / 32 * np.array([1, 2, 4])) ** 2 * 3).sum() # gridpoints per image + 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