rafaelpadilla / review_object_detection_metrics

Object Detection Metrics. 14 object detection metrics: mean Average Precision (mAP), Average Recall (AR), Spatio-Temporal Tube Average Precision (STT-AP). This project supports different bounding box formats as in COCO, PASCAL, Imagenet, etc.
Other
1.09k stars 215 forks source link

instance segmentation metrics #93

Closed andreaceruti closed 2 years ago

andreaceruti commented 2 years ago

How to modify the code in order to get the same metrics but using the instance mask (polygons/RLE) instead of using the bounding boxes for IoU overlap calculation?

rafaelpadilla commented 2 years ago

Hi @andreaceruti

You would have to replace the BoundingBox.py and its contents to something that considers the blobs (your segmented areas).

Functions iou, have_intersection, get_intersection_area, and get_union_areas should look at the blobs instead of the bounding box.

Also, thecoordinates instead of being a tuple of 4 components (x,y,width,height), it should represent the contour.

bhuvanofc commented 2 years ago

@rafaelpadilla can you please elaborate on this. I am trying to calculate the metric for my instance segmentation results. It would be really helpful as i have to evaluate fro my master thesis

rafaelpadilla commented 2 years ago

@bhuvanofc

This code was developed for bounding boxes only. For instance segmentations, the easiest way is to transform the polygons into binary blobs and work with it.

The IOU between ground-truth A and detection B would be (A and B)/(A or B). That's why, you need to change the BoundingBox.py file.

Unfortunately I'm busy with other projects and can't make that for you. But feel free to post here your questions. Maybe someone can help you

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Mirzyaaliii commented 1 year ago

Hello,

@andreaceruti and @bhuvanofc, did you find any helpful solution??

I am also working on a segmentation task and I am not sure how to calculate mAP between 2 masks (i.e., ground truth and prediction).

It would be helpful if anyone can point out to useful code or give some insights.