-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Extend LineZone to filter out miscounts #1540
Conversation
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. |
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. |
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!
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 to1
to ensure unchanged default behavior. Whenmax_linger
is set to a number greater than1
then detection must cross on all frames in order to be counted. This results in slight delay (i.e. whenmax_linger
is set to10
on10fps
video then objects will be counted with1s
delay) 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
LineZone
init docstring.