updates
This commit is contained in:
+1
-1
@@ -62,7 +62,7 @@ def labels_to_class_weights(labels, nc=80):
|
||||
weights[weights == 0] = 1 # replace empty bins with 1
|
||||
weights = 1 / weights # number of targets per class
|
||||
weights /= weights.sum() # normalize
|
||||
return torch.Tensor(weights)
|
||||
return torch.from_numpy(weights)
|
||||
|
||||
|
||||
def labels_to_image_weights(labels, nc=80, class_weights=np.ones(80)):
|
||||
|
||||
Reference in New Issue
Block a user