Skip to content

Commit

Permalink
demo: only keep detections above threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
rbgirshick committed Aug 18, 2015
1 parent 5989b41 commit 3d079c2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ def demo(net, image_name, classes):
cls_ind = CLASSES.index(cls)
cls_boxes = boxes[:, 4*cls_ind:4*(cls_ind + 1)]
cls_scores = scores[:, cls_ind]
keep = np.where(cls_scores >= CONF_THRESH)[0]
cls_boxes = cls_boxes[keep, :]
cls_scores = cls_scores[keep]
dets = np.hstack((cls_boxes,
cls_scores[:, np.newaxis])).astype(np.float32)
keep = nms(dets, NMS_THRESH)
Expand Down

0 comments on commit 3d079c2

Please sign in to comment.