当前位置:网站首页>Modify coco evaluation index maxdets=[10,15,20]

Modify coco evaluation index maxdets=[10,15,20]

2022-06-26 09:14:00 G fruit

default COCO The evaluation index maxDets=[1,10,100]

This index means to keep the confidence ranking on each graph of the test set separately The first 1、 front 10、 front 100 A prediction box , Compare these prediction boxes with the real boxes , To calculate AP、AR equivalence ( It's a little complicated. , Specifically, baidu )

stay coco On this common data set , A unified evaluation standard is needed 【 Using other people's data sets must use the evaluation criteria set by other people 】, Therefore, we can see many papers on improved algorithms in coco The effect on the data set is to use AP、AP50 These means

What I need maxDets=[10,15,20]

But I use my own dataset , Only the data format is coco The format of , The original evaluation criteria are not appropriate
for instance : If you test set a graph above the goal of more than 100 individual , You still use it. maxDets=[1,10,100], There must be something wrong with the result

According to my own data set , The target on the pictures of the test set does not exceed 20 individual , What I need maxDets=[10,15,20], To do this, just add a line of code :

find coco_evaluation.py, Found at the end of code coco_eval, Then add a line of code by referring to the following figure

''' Add here '''
coco_eval.params.maxDets=[10,15,20]##
coco_eval.evaluate()
coco_eval.accumulate()
coco_eval.summarlize()

return coco_eval

Of the screenshot here coco_evaluation.py Is from detectron2/evaluation/ Under the table of contents ( Need to install detectron2
 Insert picture description here

By the way , If you want to change the print content , You can see cocoeval.py Of _summarizeDets() Function

Of the screenshot here cocoeval.py Is from pycocotools/ Under the table of contents ( Need to install pycocotools

 Insert picture description here

原网站

版权声明
本文为[G fruit]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202170552523670.html