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

pascal_voc_evaluator.py how to get the FN #34

Closed tjbe2021 closed 3 years ago

tjbe2021 commented 3 years ago

Hi there, would you be able to help with how to get the False Negative number? Thanks.

rafaelpadilla commented 3 years ago

Hi @tjbe2021,

You could calculate the FN per image by looking at this dictionary.

As you have the recall and TP values, you can calculate FN with the recall equation: image

tjbe2021 commented 3 years ago

Thanks for the swift response, yes, as I understand from that code base and the previous version, we have got 'rec = acc_TP / npos', and according to the above equation if I subtract total_TP from the 'npos', I should be getting total FN? however, when I do this, I'm getting 0 as the result. although I can clearly see there are FNs on my detection. Any thoughts?

e.g. 'total_FN = npos - total_TP'

and when I do the followings,

total_FN = (total_TP / recall ) - total_TP

I get the results with total_fn: [nan nan nan nan nan nan nan nan nan nan nan]

Any thoughts on what I'm doing wrong in here? I tried summing the list of recall, but still gets the 'total_fn = nan'

I'm actually tweaking your earlier code, https://github.com/rafaelpadilla/Object-Detection-Metrics

tjbe2021 commented 3 years ago

Sorted! Hence, closing!