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.08k stars 215 forks source link

Added tolerance to math.isclose() function #108

Closed micheleantonazzi closed 2 years ago

micheleantonazzi commented 2 years ago

The isclose function is used to verify if the area of the BBOX calculated with the coordinates of two points and with width/height are closed to each other. I added a tolerance because their values can vary by a very very small epsilon caused by python approximations. For example, my code fails because isclose(0.90000000000001, 0.90000000000000) returns false.

rafaelpadilla commented 2 years ago

I believe the default values for isclose are: rel_tol= 1e-09 abs_tol= 0

Could you please check if these are the default values for math.isclose and make them as the default arguments for the function get_area?

micheleantonazzi commented 2 years ago

Sorry for the delay. I added the default parameters for math.isclose starting from the BoundingBox.iou function, where I get the error.

micheleantonazzi commented 2 years ago

Sorry, I do not understand. I have the error starting from the BuondingBon.iou function, so to reach the get_area I have to pass the parameters along multiple functions' sub-calls. If I modify only the get_area function I don't have the possibility to set the parameters for math.isclose, because it is used by BoundingBox.iou function. Can you clarify to me your solution?

Thank you so much!

rafaelpadilla commented 2 years ago

Hey @micheleantonazzi,

You can set the parameters manually on the function get_area directly.

When we add this parameter on the UI, then we can figure out how to pass it to the only function that really needs it: get_area

:)

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.