mean_average_precision icon indicating copy to clipboard operation
mean_average_precision copied to clipboard

Fixed negative intersection calculation

Open shaharzuler opened this issue 5 years ago • 2 comments

Hey, using np.clip() doesnt verify a_min<a_max. That caused negative intersection calculations when max_diff was negative. I noticed it when I got IoU values above 1. I replaced np.clip() with separate minimum and maximum calculations.

shaharzuler avatar Jan 16 '21 13:01 shaharzuler

Thanks for the pull request, I will check this out when I can find the time. Meanwhile, could you provide the edge case here please?

MathGaron avatar Jan 16 '21 14:01 MathGaron

sure. box_a = [[278.5549 353.25702 323.6288 459.951 ] [129.14798 10.8454895 370.7251 330.6273 ] [185.53943 154.68863 467.73505 480. ]] box_b = [[232. 353. 326. 457.]]

causes: inter = [[[ 45.073914 103.74298 ]] [[ 94. -22.372711]] [[ 94. 104. ]]]

which returns: [[ 4676.102] [-2103.035] [ 9776. ]]

shaharzuler avatar Jan 16 '21 15:01 shaharzuler