nwojke / deep_sort

Simple Online Realtime Tracking with a Deep Association Metric
GNU General Public License v3.0
5.27k stars 1.47k forks source link

Maintaing the history using kalman tracker object #194

Closed bundelesneha05 closed 3 years ago

bundelesneha05 commented 4 years ago

In SORT object in Kalman tracker, history for the bounding boxes is maintained using Kalman tracker object as shown below, is there any history is maintained in DeepSORT? or can it have any provision for maintaining history?

` def init(self,bbox): """ Initialises a tracker using initial bounding box. """

define constant velocity model

self.kf = KalmanFilter(dim_x=7, dim_z=4)
self.kf.F = np.array([[1,0,0,0,1,0,0],[0,1,0,0,0,1,0],[0,0,1,0,0,0,1],[0,0,0,1,0,0,0],  [0,0,0,0,1,0,0],[0,0,0,0,0,1,0],[0,0,0,0,0,0,1]])
self.kf.H = np.array([[1,0,0,0,0,0,0],[0,1,0,0,0,0,0],[0,0,1,0,0,0,0],[0,0,0,1,0,0,0]])

self.kf.R[2:,2:] *= 10.
self.kf.P[4:,4:] *= 1000. #give high uncertainty to the unobservable initial velocities
self.kf.P *= 10.
self.kf.Q[-1,-1] *= 0.01
self.kf.Q[4:,4:] *= 0.01

self.kf.x[:4] = convert_bbox_to_z(bbox)
self.time_since_update = 0
self.id = KalmanBoxTracker.count
KalmanBoxTracker.count += 1
self.history = []
self.hits = 0
self.hit_streak = 0
self.age = 0

`

kameel2311 commented 3 years ago

Hi did you solve this issue ?

bundelesneha05 commented 3 years ago

@kameel2311 Yes.

kameel2311 commented 3 years ago

@kameel2311 Yes.

Can you please share with me how and what to modify ?