Zhongdao / Towards-Realtime-MOT

Joint Detection and Embedding for fast multi-object tracking
MIT License
2.38k stars 539 forks source link

python 代码中joint_stracks 不太理解 #157

Closed hp-93 closed 4 years ago

hp-93 commented 4 years ago

self.tracked_stracks = [t for t in self.tracked_stracks if t.state == TrackState.Tracked] self.tracked_stracks = joint_stracks(self.tracked_stracks, activated_starcks) self.tracked_stracks = joint_stracks(self.tracked_stracks, refind_stracks) 而 def joint_stracks(tlista, tlistb): exists = {} res = [] for t in tlista: exists[t.track_id] = 1 res.append(t) for t in tlistb: tid = t.track_id if not exists.get(tid, 0): exists[tid] = 1 res.append(t) return res 求取tlista, tlistb的跟踪器并集,先保存tlista中全部跟踪器,再保存tlistb中不含tlista的track_id的跟踪器,那么activated_starcks中已经update 跟踪器不就放弃掉了吗?