Skip to content

Commit 7def403

Browse files
committed
fix bug of deepsort and c_biou
1 parent cd7c344 commit 7def403

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

tracker/c_biou_tracker.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ def update(self, new_track, frame_id):
146146
self.motion_state1 = self.get_buffer_bbox(level=1, bbox=new_tlwh)
147147
self.motion_state2 = self.get_buffer_bbox(level=2, bbox=new_tlwh)
148148

149+
# update status
150+
self.state = TrackState.Tracked
151+
self.is_activated = True
152+
153+
self.time_since_update = 0
154+
149155
@staticmethod
150156
def xywh2tlbr(xywh):
151157
"""

tracker/deepsort.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ def update(self, det_results, ori_img):
190190
lost_stracks.append(track)
191191

192192
# deal with unconfirmed tracks, match new track of last frame and new high conf det
193-
matched_pair2, u_tracks2_idx, u_det2_idx = matching.matching_cascade(self.gated_metric, 0.7, self.max_time_lost,
194-
unconfirmed, u_det1)
193+
IoU_dist = matching.iou_distance(atracks=unconfirmed, btracks=u_det1)
194+
matched_pair2, u_tracks2_idx, u_det2_idx = matching.linear_assignment(IoU_dist, thresh=0.9)
195195

196196
for itrack_match, idet_match in matched_pair2:
197197
track = unconfirmed[itrack_match]

tracker/track.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def main(opts, cfgs):
184184
timer.toc() # end timing this image
185185

186186
if opts.save_images:
187-
plot_img(img0, frame_id, [cur_tlwh, cur_id, cur_cls], save_dir=os.path.join(DATASET_ROOT, 'reuslt_images', seq))
187+
plot_img(img0, frame_id, [cur_tlwh, cur_id, cur_cls], save_dir=os.path.join(DATASET_ROOT, 'result_images', seq))
188188

189189
frame_id += 1
190190

@@ -306,7 +306,7 @@ def save_videos(seq_names):
306306
seq_names = [seq_names]
307307

308308
for seq in seq_names:
309-
images_path = os.path.join(DATASET_ROOT, 'reuslt_images', seq)
309+
images_path = os.path.join(DATASET_ROOT, 'result_images', seq)
310310
images_name = sorted(os.listdir(images_path))
311311

312312
to_video_path = os.path.join(images_path, '../', seq + '.mp4')

0 commit comments

Comments
 (0)