当前位置:网站首页>Use of cocoeval function

Use of cocoeval function

2022-06-10 22:41:00 Wu lele~


background

 coco Data sets are often used in target detection tasks , and coco Don't like voc So straightforward . Especially in terms of evaluation methods . therefore , Recorded in this article cocoeval Function USES , Have a bad memory .


1、 Code

from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
import numpy as np
import pylab,json

if __name__ == "__main__":
    gt_path = "/home/wujian/WLL/mmdet-master/data/coco/annotations/instances_val2017.json"  #  The path where the real label is stored 
    dt_path = "/home/wujian/WLL/mmdet-master/tools/work_dirs/yolo_result/my_result.json"    #  The path where the test results are stored 
    cocoGt = COCO(gt_path)
    cocoDt = cocoGt.loadRes(dt_path)
    cocoEval = COCOeval(cocoGt, cocoDt, "bbox")                                             #
    cocoEval.evaluate()
    cocoEval.accumulate()
    cocoEval.summarize()

2、 File download

File download address in code
[ Be careful ]: The above two documents bbox It's all [xmin,ymin,w,h] Format !! If you have any questions, welcome +vx:wulele2541612007, Pull you into the group to discuss communication .

原网站

版权声明
本文为[Wu lele~]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206101653417806.html