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

Moving object tracking #4

Closed yuninn closed 3 years ago

yuninn commented 3 years ago

Hello, I use yolov5 to detect moving vehicles,and I don’t detect stationary vehicles, so when the target moves from motion to static to motion, the tracking will be lost. Is there any good solution?

tensorturtle commented 3 years ago

If the track ID is being lost because of rapid motion, you can do two things.

  1. Decrease SORT IOU threshold argument. For example, classy-track.py --sort-iou-thresh 0.1
  2. Increase SORT Kalman Filter process noise coefficient. In SORT/sort.py line 122, change 0.5 to something higher: self.kf.Q[-1,-1] *= 0.5 # Q: Covariance matrix of process noise (set to high for erratically moving things)
yuninn commented 3 years ago

If the track ID is being lost because of rapid motion, you can do two things.

  1. Decrease SORT IOU threshold argument. For example, classy-track.py --sort-iou-thresh 0.1
  2. Increase SORT Kalman Filter process noise coefficient. In SORT/sort.py line 122, change 0.5 to something higher: self.kf.Q[-1,-1] *= 0.5 # Q: Covariance matrix of process noise (set to high for erratically moving things)

Thank you for your help, the effect is much better!

ingbeeedd commented 2 years ago

@tensorturtle What is the problem with the id changing of the objects that are stationary ? sort-max-age param is also set long, but this is the problem.

tensorturtle commented 2 years ago

Hi @ingbeeedd Tracking can't be expected to have perfect accuracy, and unfortunately there may be id switches even on stationary objects, although that should be rare. If you need more help, send me a sample video output and I can take a look.

ingbeeedd commented 2 years ago

@tensorturtle Where should I send it?

tensorturtle commented 2 years ago

@ingbeeedd You could upload it to youtube as an unlisted video and comment the link, or send it to tensorturtle@gmail.com