From 249313be6ce2c58916ad4fc5bce93a0dd10f7997 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 26 Feb 2019 15:11:22 +0100 Subject: [PATCH] updates --- test.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test.py b/test.py index df5a886b..fa258eef 100644 --- a/test.py +++ b/test.py @@ -146,17 +146,13 @@ def test( from pycocotools.coco import COCO from pycocotools.cocoeval import COCOeval - # initialize COCO ground truth api - cocoGt = COCO('../coco/annotations/instances_val2014.json') - - # initialize COCO detections api - cocoDt = cocoGt.loadRes('results.json') + # https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocoEvalDemo.ipynb + cocoGt = COCO('../coco/annotations/instances_val2014.json') # initialize COCO ground truth api + cocoDt = cocoGt.loadRes('results.json') # initialize COCO detections api cocoEval = COCOeval(cocoGt, cocoDt, 'bbox') cocoEval.params.imgIds = imgIds # [:32] # only evaluate these images - cocoEval.evaluate() - cocoEval.accumulate() - cocoEval.summarize() + cocoEval.evaluate().accumulate().summarize() # Return mAP return mean_mAP, mean_R, mean_P