Zhen Ye commited on
Commit
0834617
·
1 Parent(s): 6896025

Fix: IndexError in ByteTracker

Browse files
Files changed (1) hide show
  1. utils/tracker.py +4 -5
utils/tracker.py CHANGED
@@ -445,15 +445,14 @@ class ByteTracker:
445
 
446
  # 4. Init new tracks from unmatched high score detections
447
  # Note: Unmatched low score detections are ignored (noise)
448
- detections = [detections[i] for i in u_detection]
449
- for inew in u_detection:
450
- track = detections[inew]
451
  if track.score < self.track_thresh:
452
  continue
453
-
454
  track.activate(self.kalman_filter, self.frame_id)
455
  activated_stracks.append(track)
456
- self._sync_data(track, track) # Sync self
457
 
458
  # 5. Update state
459
  self.tracked_stracks = [t for t in self.tracked_stracks if t.state == 2]
 
445
 
446
  # 4. Init new tracks from unmatched high score detections
447
  # Note: Unmatched low score detections are ignored (noise)
448
+ unmatched_dets = [detections[i] for i in u_detection]
449
+ for track in unmatched_dets:
 
450
  if track.score < self.track_thresh:
451
  continue
452
+
453
  track.activate(self.kalman_filter, self.frame_id)
454
  activated_stracks.append(track)
455
+ self._sync_data(track, track) # Sync self
456
 
457
  # 5. Update state
458
  self.tracked_stracks = [t for t in self.tracked_stracks if t.state == 2]