From 00e3fe719494a7d464a1f9d9a2a7a6a2a654981c Mon Sep 17 00:00:00 2001 From: Xinlei Chen Date: Sun, 26 Feb 2017 18:35:43 -0500 Subject: [PATCH] GT boxes: exclude the ones that are iscrowd from COCO --- lib/roi_data_layer/minibatch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/roi_data_layer/minibatch.py b/lib/roi_data_layer/minibatch.py index f4535b022..4fc136614 100644 --- a/lib/roi_data_layer/minibatch.py +++ b/lib/roi_data_layer/minibatch.py @@ -34,7 +34,8 @@ def get_minibatch(roidb, num_classes): assert len(im_scales) == 1, "Single batch only" assert len(roidb) == 1, "Single batch only" # gt boxes: (x1, y1, x2, y2, cls) - gt_inds = np.where(roidb[0]['gt_classes'] != 0)[0] + # For the GT boxes, exclude the ones that are ''iscrowd'' + gt_inds = np.where(roidb[0]['gt_classes'] != 0 & np.all(roidb[0]['gt_overlaps'].toarray() > -1.0, axis=1))[0] gt_boxes = np.empty((len(gt_inds), 5), dtype=np.float32) gt_boxes[:, 0:4] = roidb[0]['boxes'][gt_inds, :] * im_scales[0] gt_boxes[:, 4] = roidb[0]['gt_classes'][gt_inds]