-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add possibility to manually scale the process noise covariance matrix #1484
Conversation
The parameters in this repo are optimized for MOT17 in which most sequences are 30FPS.
Seems like a reasonable PR to me 😄, for customization, specially at lower frame rates.
This request may be outside your research scope. But would you be interested in adding this to the BoTSORT KF? This would make the process noise searchable with the
The separation and redundancy in the KFs has been due to lack of time. I can do the filter cleaning and adding the parameters to the genetic parameter search in a later PR 🚀 |
Did you find these values being a good start for tracking at 5FPS in your experiments? Q_xy_scaling = 0.01,
Q_s_scaling = 0.0001 |
Ah no, this default initialization just ensures, that the KF behaves the same as before without the parameters. self.kf.Q[-1, -1] *= 0.01
self.kf.Q[4:, 4:] *= 0.01 resulting in the diagonal being: So the behaviour of the KF only changes if the user actively adjusts |
I haven't really looked into the KF in BoTSort because we're mainly using and researching OCSort right now. But your idea sounds great, and I'll check it out when I find the time! :)
That sounds great, thanks!! 🚀 |
Ohh. Yes, your are right, I just revisited the OCSORT KF.
BoTSORT or ByteTrack KF, whichever you find easier to work with 😄 |
I just refactored the KFs @edblu1! I still have to unify all |
What where the values you got to, if I may ask: Q_xy_scaling = 0.01,
Q_s_scaling = 0.0001 for your 5 FPS videos? |
Great! 🚀
We haven't tested that many configurations yet, but one that worked quite well was to keep Q as an identity Matrix. Of course there are scenarios where such a "high" uncertainty will not provide optimal tracking behaviour, especially in scenes with long occlusions. |
Hi! I have now finally updated the xysr Trackers I noticed, that Hybridsort also incorporates a xysr KalmanFilter, but with 9 dimensions instead of 7. |
I agree. Let's keep this as it is for now. Good job on the PR! Merging |
I now added the possibility to search this parameter using the evolve script 🚀 |
Great, Thanks for incorporating this so fast! 🚀 |
Hey!
We've been using the boxmot yolo_tracking repository with the OCSort tracker for a while, and we encountered a small issue. At lower framerates, like 5 fps, we noticed the Kalman Filter predictions weren't performing as well as we'd hoped. Specifically, the predictions seemed too strict and stiff, especially in dynamic environments where the bounding box sizes and positions change a lot.
After some investigation and experimentation, we found that adjusting the Q Matrix (process noise covariance) to increase the uncertainty/noise level significantly improved prediction performance in our tests. However, the current repository doesn't offer a straightforward way to make this adjustment, so we created this pull request to make it easier to adjust the process noise covariance matrix if needed.
As changes we added two new parameters to the
OCSort
class. One parameter scales the expected process noise of the center of the bounding box, and the other scales the process noise of the size of the bounding box. This way, users can fine-tune the Kalman Filter to better suit their specific scenarios. We've also added a pytest function to validate the proper functioning of our changes.We've also included some example video snippets to showcase the suboptimal behavior and the improvement after the adjustment. In these clips, a car navigates a traffic circle, causing rapid changes in both direction and scale of the bounding box. The current Kalman filter setup struggles to handle these dynamic changes and thus seems to lag behind.
In the videos, the Kalman Filter prediction is shown in blue, while the detected bounding box is shown in yellow.
We'd be really happy if you could accept this pull request, but we totally understand if it's not something you want to incorporate into the main repository. In that case, we'll maintain our own fork. If you need any further adjustments in the code, please let us know, and we will incorporate them.
Thanks a bunch for considering this!