From 99f32fa27e95665d721b460ddbf78e6f6fe5c493 Mon Sep 17 00:00:00 2001 From: michaelzhaobin <31604328+michaelzhaobin@users.noreply.github.com> Date: Sat, 3 Mar 2018 14:34:35 +0800 Subject: [PATCH] Update roidb.py --- lib/roi_data_layer/roidb.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/roi_data_layer/roidb.py b/lib/roi_data_layer/roidb.py index 97a6a761..9ab35f01 100644 --- a/lib/roi_data_layer/roidb.py +++ b/lib/roi_data_layer/roidb.py @@ -47,13 +47,14 @@ def add_bbox_regression_targets(roidb): """Add information needed to train bounding-box regressors.""" assert len(roidb) > 0 assert 'max_classes' in roidb[0], 'Did you call prepare_roidb first?' - + num_images = len(roidb) # Infer number of classes from the number of columns in gt_overlaps num_classes = roidb[0]['gt_overlaps'].shape[1] for im_i in xrange(num_images): rois = roidb[im_i]['boxes'] max_overlaps = roidb[im_i]['max_overlaps'] + # max_classes = roidb[im_i]['max_classes'] roidb[im_i]['bbox_targets'] = \ _compute_targets(rois, max_overlaps, max_classes)