This commit is contained in:
Glenn Jocher 2019-12-25 14:55:11 -08:00
parent 34d9392bac
commit d1087f4987
1 changed files with 2 additions and 1 deletions

View File

@ -537,6 +537,7 @@ def non_max_suppression(prediction, conf_thres=0.5, nms_thres=0.5, multi_cls=Tru
pred = torch.cat((box, conf.unsqueeze(1), j.float().unsqueeze(1)), 1)
# Apply finite constraint
if not torch.isfinite(pred).all():
pred = pred[torch.isfinite(pred).all(1)]
# Batched NMS