"...text-generation-inference.git" did not exist on "9946165ee022bf31578e1dde3124cc61ded2b664"
Unverified Commit 5a7010f6 authored by Francisco Massa's avatar Francisco Massa Committed by GitHub
Browse files

Remove empty boxes before NMS (#1019)

parent 5ba95873
......@@ -501,6 +501,10 @@ class RoIHeads(torch.nn.Module):
inds = torch.nonzero(scores > self.score_thresh).squeeze(1)
boxes, scores, labels = boxes[inds], scores[inds], labels[inds]
# remove empty boxes
keep = box_ops.remove_small_boxes(boxes, min_size=1e-2)
boxes, scores, labels = boxes[keep], scores[keep], labels[keep]
# non-maximum suppression, independently done per class
keep = box_ops.batched_nms(boxes, scores, labels, self.nms_thresh)
# keep only topk scoring predictions
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment