norfair icon indicating copy to clipboard operation
norfair copied to clipboard

ReID

Open facundo-lezama opened this issue 2 years ago • 4 comments

This PR implements a ReID phase to the existing matching algorithm. This ReID phase tackles those cases where the simple matching of TrackedObjects and Detections based on Kalman filter isn't enough. Although it is intended to be used with an appearance model, it doesn't restrict other approaches. It simply adds a phase where TrackedObjects that weren't matched to any Detection may be matched to TrackedObjects that are not yet initialized.

The motivation behind this approach is that when an object reappears, it may take some frames until it is clearly visible. This may cause the old TrackedObject doesn't get matched to these partially occluded detections and a new TrackedObject is created. If this happens, new detections of the reappeared object will most likely get matched to the newly created TrackedObject and never get matched to the old one. Hence old TrackedObject will eventually die and the new one will continue to live. But by adding this new phase, we can take into account the newly created TrackedObject and try to match it to the old one, maintaining a single TrackedObject that keeps track of the same object before and after occlusion.

For this purpose, an embedding field was added to the Detection class enabling appearance matching. Also, the matching algorithm was modified to add the ReID phase after the ones already implemented inside update in the Tracker class. To enable this new phase to be customized by the user, now the Tracker class accepts a reid_distance_function besides the already known distance_function.

facundo-lezama avatar Jun 03 '22 19:06 facundo-lezama

I made the requested changes. For removing the EMA I did a rebase so that the history remains clean.

facundo-lezama avatar Jun 06 '22 13:06 facundo-lezama

Pending tasks to merge this PR:

  • [x] Add some demo showcasing the new feature

facundo-lezama avatar Jun 08 '22 20:06 facundo-lezama

Pending tasks to merge this PR:

* [ ]  Add some demo showcasing the new feature

Is there any progress on the demo? I am looking forward to try it out

nikky4D avatar Jul 06 '22 16:07 nikky4D

This thread mentions a demo showing improved accuracy, but I can't seem to find it in the branch - was it included?

polyted avatar Aug 02 '22 13:08 polyted