Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix external track ids #1364

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

rolson24
Copy link
Contributor

Description

This fix is for issue #1355. The tracker is skipping ID's for a few reasons. First off when the minimum_consecutive_frames is set to 1, each track gets assigned a new external id when it is created in activate() is called. This is an issue because not all of these tracks make it through the next frame where they get matched with a new detection and update() gets called. That means we are assigning an external track id to tracks that never are real tracks. I fixed this by getting rid of the external track id assignment in activate() (except for the first frame of the video) and instead just using the external id assignment in the update() function, which is how we do the assignment when minimum_consecutive_frames > 1.

The second reason the tracker is skipping ID's is because in the removed_duplicate_tracks() function, there is an overlap threshold to determine if two tracks are the same. In the current release this threshold is set at 0.15 which is relatively high because two tracks could be passing by each other and if they overlap more than 85% one would get removed. I lowered the threshold to 0.05 to reduce this.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How has this change been tested, please provide a testcase or example of how you tested the change?

This fix was tested with this notebook

Here you can see that in the old version external id 4 was skipped, but in the new version its not

Output from old version:

Current Frame: 38
New Track ids: set()
Track ids are consecutive: True
Current Frame: 39
New Track ids: set()
Track ids are consecutive: True
Current Frame: 40
New Track ids: set()
Track ids are consecutive: True
Current Frame: 41
New Track ids: {3, 5}
Track ids are consecutive: False
Current Frame: 42
New Track ids: set()
Track ids are consecutive: False
Current Frame: 43
New Track ids: set()
Track ids are consecutive: False
Current Frame: 44
New Track ids: set()

Image

Output from fixed version:

Current Frame: 38
New Track ids: set()
Track ids are consecutive: True
Current Frame: 39
New Track ids: set()
Track ids are consecutive: True
Current Frame: 40
New Track ids: set()
Track ids are consecutive: True
Current Frame: 41
New Track ids: {3, 4}
Track ids are consecutive: True
Current Frame: 42
New Track ids: set()
Track ids are consecutive: True
Current Frame: 43
New Track ids: set()
Track ids are consecutive: True
Current Frame: 44
New Track ids: set()
Track ids are consecutive: True

Image

Any specific deployment considerations

For example, documentation changes, usability, usage/costs, secrets, etc.

Docs

  • Docs updated? What were the changes:

@SkalskiP
Copy link
Collaborator

Hi @rolson24 👋🏻, we have two issues related to tracking that were submitted recently:

IS it related to both of them or only #1355?

@rolson24
Copy link
Contributor Author

rolson24 commented Jul 17, 2024 via email

supervision/tracker/byte_tracker/core.py Outdated Show resolved Hide resolved
supervision/tracker/byte_tracker/core.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants