norfair
norfair copied to clipboard
ReID
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
.
I made the requested changes. For removing the EMA I did a rebase so that the history remains clean.
Pending tasks to merge this PR:
- [x] Add some demo showcasing the new feature
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
This thread mentions a demo showing improved accuracy, but I can't seem to find it in the branch - was it included?