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

Kalman filter input #8

Closed yuninn closed 2 years ago

yuninn commented 2 years ago

Excuse me, I meet a problem. For an image with multiple targets in a frame, how do you determine the input x of the Kalman filter? Is all the boxes formed into a matrix and input at one time, or the column vectors of each box are updated iteratively. Looking forward to your precious reply

tensorturtle commented 2 years ago

For each frame, all the detections (represented by a vector) are stacked into a single 2d array, then passed onto SORT.

https://github.com/tensorturtle/classy-sort-yolov5/blob/0b9b88651f5a27ec0583a159f759430576700194/classy_track.py#L195-L196

yuninn commented 2 years ago

First of all, thank you for your enthusiastic reply. For example, there are 3 target boxes in the nth frame, and the n+1th frame has 4 target boxes. For the nth frame, the Kalman filter input is a 3-column 2d matrix. The input of n+1 is a 4-column 2d matrix, am I right?

---Original--- From: "Jason @.> Date: Thu, Sep 23, 2021 01:10 AM To: @.>; Cc: @.**@.>; Subject: Re: [tensorturtle/classy-sort-yolov5] Kalman filter input (#8)

For each frame, all the detections (represented by a vector) are stacked into a single 2d array, then passed onto SORT.

https://github.com/tensorturtle/classy-sort-yolov5/blob/0b9b88651f5a27ec0583a159f759430576700194/classy_track.py#L195-L196

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

tensorturtle commented 2 years ago

It would be more helpful if you could tell me which lines of code you are looking at.

if you want to inspect the variables at runtime, I recommend inserting

import IPython; IPython.embed()

at the lines you are interested in examining. From there, you can use interactive python REPL to see the dimensions of inputs/outputs.