This commit is contained in:
Glenn Jocher 2019-04-24 16:39:56 +02:00
parent 55aaf9a21e
commit 20bb5f0a6a
1 changed files with 1 additions and 1 deletions

View File

@ -351,7 +351,7 @@ def non_max_suppression(prediction, conf_thres=0.5, nms_thres=0.5):
pred[:, 4] *= class_conf
# Select only suitable predictions
i = (pred[:, 4] > conf_thres) & (pred[:, 2:4] > min_wh).all(1) & (torch.isnan(pred).any(1) == 0)
i = (pred[:, 4] > conf_thres) & (pred[:, 2:4] > min_wh).all(1) & torch.isfinite(pred).all(1)
pred = pred[i]
# If none are remaining => process next image