DINO icon indicating copy to clipboard operation
DINO copied to clipboard

Per category evaluation

Open david-rohrschneider opened this issue 2 years ago • 5 comments

Hello there, is it possible to run the coco evaluation per category or class?

david-rohrschneider avatar Jan 11 '23 13:01 david-rohrschneider

You can refer to https://github.com/cocodataset/cocoapi/issues/276

HaoZhang534 avatar Jan 18 '23 23:01 HaoZhang534

It will do per class but for a specific AP threshold. How would we do per class for [email protected] ?

Robotatron avatar Jan 19 '23 00:01 Robotatron

@Robotatron Have you tried it? I think it will give the AP for [email protected].

HaoZhang534 avatar Jan 19 '23 03:01 HaoZhang534

@Robotatron Have you tried it? I think it will give the AP for [email protected].

I figured it out. It seems my colleague modified the coco eval code and he had iouThr set to 0.5 here: https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocotools/cocoeval.py#L460

I set iouThr to None (as it is in the source) to get [email protected].

Robotatron avatar Jan 19 '23 11:01 Robotatron

I just added following lines to cocoeval.py(457-464) and then it worked:

avg_ap = 0.0
if ap == 1:
    for i in range(0, num_classes):
        print('category : {0} : {1}'.format(i,np.mean(s[:,:,i,:])))
        avg_ap +=np.mean(s[:,:,i,:])
    print('(all categories) mAP : {}'.format(avg_ap / num_classes))

david-rohrschneider avatar Jan 19 '23 16:01 david-rohrschneider