tryolabs / norfair

Lightweight Python library for adding real-time multi-object tracking to any detector.
https://tryolabs.github.io/norfair/
BSD 3-Clause "New" or "Revised" License
2.39k stars 243 forks source link

Detection age not always set #317

Open nmichlo opened 5 months ago

nmichlo commented 5 months ago

Describe the bug

Age is not set on all newly added detections.

To Reproduce

Set past_detections_length to some low number, and add more detections than this. The detection age will not be set after being "added" when discarded.

Expected behavior

Even when discarded, the detection age should still be set after being added, because this affects the last_detection.

https://github.com/tryolabs/norfair/blob/009a1b171ab14336d79d7b7b02dfa5f45066c79e/norfair/tracker.py#L700-L715

Seems like the above lines should always set the detection age. It should also probably assert that the age has not already been set / added to a tracker.

Screenshots or videos N/A

Environment (please complete the following information):

Additional context N/A