Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 inactivate()
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 andupdate()
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 inactivate()
(except for the first frame of the video) and instead just using the external id assignment in theupdate()
function, which is how we do the assignment whenminimum_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.
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:
Output from fixed version:
Any specific deployment considerations
For example, documentation changes, usability, usage/costs, secrets, etc.
Docs