cheind / py-motmetrics

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

Would like to know the detail of ID-score #63

Closed ghost closed 4 years ago

ghost commented 4 years ago

I am very new to multiple object tracking, and I am confusing about the calculation of ID scores (IDFN, IDTP, ...). In the metrics.py, the matching between objects (groundtruth trajectories) and hypotheses (tracked trajectories) are associated based on cost optimization. The calculation seems to be utilizing the per-frame matching (Hungarian ?) results, because the event dataframe without rows of "match" is utilized. Why is that ? In my understanding, the global matching is not related to per-frame matching, but is that incorrect ? Please tell me some more explanation about global matching, as well as the meanings of fpmatrix and fnmatrix, if you do not mind.

jvlmdr commented 4 years ago

Hi. You are correct that the ID scores use an optimal assignment between ground-truth tracks and predicted tracks. This is a different assignment problem to that solved in each frame. This assignment is chosen to minimise the number of FPs and FNs. The fpmatrix and fnmatrix are constructed using the number of matches between each ground-truth track and predicted track, and the number of times each one occurs.

The ID scores deliberately do not use the per-frame matching, this is why they exclude the "match" events and only take the "raw" events.

ghost commented 4 years ago

Thank you for your clear explanation. I understood. I was confused because I had thought the "RAW" rows of df corresponded to some kind of events (as well as MATCH, MISS, ...), but I realized such rows does not indicate any events (event rows are separate).I also understood that the fpmatrix[i, j] means the number of false positive frames in the case when track oids[i] and hypothesis hids[j] are matched, and the fnmatrix is similar, too.

jvlmdr commented 4 years ago

OK, great! :)