diff --git a/dygraph/ppdet/metrics/metrics.py b/dygraph/ppdet/metrics/metrics.py index 304495f65a2ea93e641254d257ba3d3ec53b0e38..f4eecfb2dc61b5b00bf1364c8841ae54901990e6 100644 --- a/dygraph/ppdet/metrics/metrics.py +++ b/dygraph/ppdet/metrics/metrics.py @@ -149,9 +149,9 @@ class VOCMetric(Metric): self.detection_map.reset() def update(self, inputs, outputs): - bboxes = outputs['bbox'].numpy() - scores = outputs['score'].numpy() - labels = outputs['label'].numpy() + bboxes = outputs['bbox'][:, 2:].numpy() + scores = outputs['bbox'][:, 1].numpy() + labels = outputs['bbox'][:, 0].numpy() bbox_lengths = outputs['bbox_num'].numpy() if bboxes.shape == (1, 1) or bboxes is None: diff --git a/dygraph/ppdet/modeling/proposal_generator/rpn_head.py b/dygraph/ppdet/modeling/proposal_generator/rpn_head.py index be399be9e98437c44e66c0deec1afed0b82f1445..5658e99479bce56aff86208a6cb21e0357e55aee 100644 --- a/dygraph/ppdet/modeling/proposal_generator/rpn_head.py +++ b/dygraph/ppdet/modeling/proposal_generator/rpn_head.py @@ -110,7 +110,7 @@ class RPNHead(nn.Layer): # TODO: Fix batch_size > 1 when testing. if self.training: - batch_size = im_shape.shape[0] + batch_size = inputs['im_shape'].shape[0] else: batch_size = 1