updates
This commit is contained in:
parent
57417e7080
commit
249313be6c
12
test.py
12
test.py
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue