Skip to content

Conversation

@shaharzuler
Copy link

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.

Replaced np.clip() with separate minimum-maximum check, since np.clip() doesnt verify a_min<a_max. np.clip() sometimes caused negative IoU intersection values.
Updated intersect_area() calculation - fixed negative IoU values
@MathGaron
Copy link
Owner

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?

@shaharzuler
Copy link
Author

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. ]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants