yolact
yolact copied to clipboard
producing classwise results for coco
could somebody help me with producing boxAP and maskAP for each class.
Did you find a solution so far?
I have a solution: fisrt run the evaluation script whrich produces the json result files python eval.py --trained_model=weights/yolact_base_54_800000.pth --output_coco_json the run python run_coco_eval.py
you can either change in run_coco_eval: bbox_eval = COCOeval(gt_annotations, bbox_dets, 'bbox') bbox_eval.params.catIds = [7] # person id : 1 #bbox_eval.params.imgIds = imgIds bbox_eval.evaluate() bbox_eval.accumulate() bbox_eval.summarize() then you get only the results for the specific class
or you can add in cocoeval.py in line 456 #cacluate AP(average precision) for each category num_classes = 80 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))
it will additionaly print all the results per class
I will check it out. Thank you for informing
hello all do you know how can i print precision and recall for each class? thanks
@sabine1993 Thanks for your effort. But has anyone been successful with @sabine1993 code? It wasn't successful in my case