Extend LineZone to filter out miscounts#1540
Merged
Conversation
Contributor
|
I'd witnessed this but hadn't verified it. Very nice contribution yet again! I'll take some time to cehck it, especially regarding how the model IDs / edge cases. |
LinasKo
reviewed
Nov 5, 2024
LinasKo
reviewed
Nov 5, 2024
Contributor
|
Hey @grzegorz-roboflow, I made some heavy edits and think it's good to go. You wouldn't happen to have the traffic video you used to test it, would you? Edit: Found it. |
Contributor
|
Tested in a Colab: https://colab.research.google.com/drive/1rVuuJGPH-la2ExDmEUkKxwBnxRZMvgTK?usp=sharing It works very similarly to how it was presented in Grzegorz's video. Final results at different thresholds:
|
LinasKo
approved these changes
Nov 6, 2024
Contributor
LinasKo
left a comment
There was a problem hiding this comment.
Thank you very much @grzegorz-roboflow! At long last, we're adding it to the repo :)
Expect to see it in the new supervision version this weekend!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
LineZone is checking if line was crossed by comparing detection position relative to the line across 2 frames. This is resulting in miscounts when bbox flickers.
Below video shows difference in counts between current develop and this PR.
traffic_side_by_side.mp4
In this PR new init param is added called
max_linger, which is by default set to1to ensure unchanged default behavior. Whenmax_lingeris set to a number greater than1then detection must cross on all frames in order to be counted. This results in slight delay (i.e. whenmax_lingeris set to10on10fpsvideo then objects will be counted with1sdelay) however more accurate counts.Type of change
How has this change been tested, please provide a testcase or example of how you tested the change?
Added unit tests
Any specific deployment considerations
N/A
Docs
I updated
LineZoneinit docstring.