This commit is contained in:
Glenn Jocher 2019-02-26 15:11:22 +01:00
parent 57417e7080
commit 249313be6c
1 changed files with 4 additions and 8 deletions

12
test.py
View File

@ -146,17 +146,13 @@ def test(
from pycocotools.coco import COCO from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval from pycocotools.cocoeval import COCOeval
# initialize COCO ground truth api # https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocoEvalDemo.ipynb
cocoGt = COCO('../coco/annotations/instances_val2014.json') cocoGt = COCO('../coco/annotations/instances_val2014.json') # initialize COCO ground truth api
cocoDt = cocoGt.loadRes('results.json') # initialize COCO detections api
# initialize COCO detections api
cocoDt = cocoGt.loadRes('results.json')
cocoEval = COCOeval(cocoGt, cocoDt, 'bbox') cocoEval = COCOeval(cocoGt, cocoDt, 'bbox')
cocoEval.params.imgIds = imgIds # [:32] # only evaluate these images cocoEval.params.imgIds = imgIds # [:32] # only evaluate these images
cocoEval.evaluate() cocoEval.evaluate().accumulate().summarize()
cocoEval.accumulate()
cocoEval.summarize()
# Return mAP # Return mAP
return mean_mAP, mean_R, mean_P return mean_mAP, mean_R, mean_P