tryolabs / norfair

Lightweight Python library for adding real-time multi-object tracking to any detector.
https://tryolabs.github.io/norfair/
BSD 3-Clause "New" or "Revised" License
2.41k stars 247 forks source link

Add optimized IoU function #226

Closed facundo-lezama closed 1 year ago

facundo-lezama commented 1 year ago

This PR adds a new implementation for the IoU distance calculation by leveraging numpy for vectorized calculations.

Changes include:

NOTE: We also implemented an optimized IoU function in Cython at https://github.com/tryolabs/norfair/pull/213, but after profiling both implementations, we saw that the performance was almost the same. Thus we decided to use the one introduced in this PR due to its simplicity.

Pending: