tensorturtle / classy-sort-yolov5

Ready-to-use realtime multi-object tracker that works for any object category. YOLOv5 + SORT implementation.
GNU General Public License v3.0
110 stars 29 forks source link

I'd like to get some Kalman Filter advice on my situation. #18

Closed YoungjaeDev closed 1 year ago

YoungjaeDev commented 1 year ago

Hello I saw the picture on README, and the reason why the camera is shaking is that it's tracking pretty well is because,

  1. Camera is generally following the person(and bike) in front of me
  2. In general, the inference box is large, so the association works well

Can you say that? I'm also a little bit hard to track pretty small boxes when the camera is shaking, because there are situations where the object is moving and the camera is moving in the opposite direction

tensorturtle commented 1 year ago

Hi @youngjae-avikus You're right about both, and they are basically fundamental limitations of SORT. If you can tell me more about your use case / deployment environment, maybe I can answer the question more specifically.

YoungjaeDev commented 1 year ago

@tensorturtle Basically, the Kalman filter model used in the sort tracker assumes a Linear Kalman Filter (LKF), right?

tensorturtle commented 1 year ago

@youngjae-avikus Correct

YoungjaeDev commented 1 year ago

@tensorturtle I didn't know well, but I lowered the predict value because I thought the reliability of the measured value was high, but come to think of it, the inference box was also shaken. So I'm going to have to explore the ratio of between the estimates value and the measurement value

YoungjaeDev commented 1 year ago

@tensorturtle Did you adjust the R and Q parameters by measuring the quantitative metric (e.g CLEAR MOTA)?

tensorturtle commented 1 year ago

@youngjae-avikus No, I did not use quantitative methods.

YoungjaeDev commented 1 year ago

@tensorturtle Thank you!

YoungjaeDev commented 1 year ago

@tensorturtle image

I have a new question Can you tell me what the constant velocity value is in the estimation model? Is it correct to calculate the predict position value with dt* (constant velocity)?

YoungjaeDev commented 1 year ago
The tracker is initialised using the geometry of the bounding box with the velocity set to zero. Since the velocity is unobserved at this point the covariance of the velocity component is initialised with large values, reflecting this uncertainty

It's written on the paper

YoungjaeDev commented 1 year ago

But can you tell me what the constant velocity value is in the estimation model?

tensorturtle commented 1 year ago

I think you can find the estimated velocity within state, written in sort.py as self.kf.x, for example: https://github.com/tensorturtle/classy-sort-yolov5/blob/4778dcf91300d212fc3c72500f4a364bf931abdd/sort/sort.py#L173

YoungjaeDev commented 1 year ago

@tensorturtle Oh, I got it The current xpos system model itself x(t+1) = x(t) + dt *vel... also ypos That's why they call it a constant speed model As mentioned in the paper, wasn't the constant speed model suitable for the environment you are developing. Based on what I have as a test set, I think it will be supplemented by moving the velocity with some noise (Below fig) image

If so, how can you define the acceleration model? Is there a limit to the current measurement (box) material?

Thank you!

tensorturtle commented 1 year ago

@youngjae-avikus You're definitely on the right track. Depending on the application, it is possible that the acceleration term is not necessary. Were you able to graph the acceleration for X and Y as well?

YoungjaeDev commented 1 year ago

@tensorturtle image Looks like equivalent acceleration