levan92 / deep_sort_realtime

A really more real-time adaptation of deep sort
MIT License
167 stars 51 forks source link

Identity switch #37

Closed shamindraparui closed 1 year ago

shamindraparui commented 1 year ago

Hi, I am using Yolo5 (Person class) with DeepSortRealtime. Tracking is happening but identity of person(s) switches even when really short occlusion occurs (between person-person, person-object). I have checked the result with CLIP embedder, max_age parameter, no luck. Can anyone provide some suggestions on minimizing the identity switch?

DCCCXIX commented 1 year ago

Any success on solving this problem?

romarcg commented 1 year ago

Have you computed the feature distance distribution between correct and incorrect identities in your target scenario? This can help you to correctly choose the proper max_cosine_distance parameter used in the first association step (gating distance + appearance distance).

https://github.com/levan92/deep_sort_realtime/blob/f11a5869ccd669338aacf6f19364b7cd3596b89f/deep_sort_realtime/deep_sort/tracker.py#L151

The default distance gating will consider close measurements (detections) to the projected track. If your max_cosine_distance is too broad, it might result in an incorrect linear assignment and an identity switch.

Also, this might be related to an unconfirmed issue when comparing new detection features to the confirmed track feature histories.

Jordan-Pierce commented 1 year ago

Hi @romarcg, is there a specific way of computing this beforehand?

levan92 commented 1 year ago

some cross track/identity switch are inevitable in real-life applications, especially when people are not wearing distinctively different attires. try playing around with max_age, max_cosine_distance as mentioned by @romarcg, or even training a better person re-identification network that better suits your deployment environment.