cheind / py-motmetrics

:bar_chart: Benchmark multiple object trackers (MOT) in Python
MIT License
1.37k stars 259 forks source link

IoU Distance Calculation Annotation? #142

Closed samuelsciberras closed 3 years ago

samuelsciberras commented 3 years ago

Hi, I am trying to use py-motmetrics with calculating IoU Distance metric, but it is returning NaN result for overlapping bounding boxes due to i_vol being 0. I suspect that the X,Y,W,H I am passing are incorrect.

Here is my setup; X axis counts from left to right Y axis counts from top to bottom This means that (0,0) is the top left of the image.

Width and Height range from 0 to ImageSize-1

Does this correspond to what the library expects, or should I be passing the centroid as X,Y for example?

cheind commented 3 years ago

Yes that is correct. See

https://github.com/cheind/py-motmetrics/blob/develop/motmetrics/distances.py#L83

You might see np.nan because iou-distance is greater than a pre-defined threshold.

samuelsciberras commented 3 years ago

Thanks, something was wrong with my dataset