MCPcopy Create free account
hub / github.com/FoundationVision/ByteTrack / update

Method update

yolox/deepsort_tracker/deepsort.py:48–79  ·  view source on GitHub ↗

Perform measurement update and track management. Parameters ---------- detections : List[deep_sort.detection.Detection] A list of detections at the current time step.

(self, detections, classes)

Source from the content-addressed store, hash-verified

46 track.mark_missed()
47
48 def update(self, detections, classes):
49 """Perform measurement update and track management.
50 Parameters
51 ----------
52 detections : List[deep_sort.detection.Detection]
53 A list of detections at the current time step.
54 """
55 # Run matching cascade.
56 matches, unmatched_tracks, unmatched_detections = \
57 self._match(detections)
58
59 # Update track set.
60 for track_idx, detection_idx in matches:
61 self.tracks[track_idx].update(
62 self.kf, detections[detection_idx])
63 for track_idx in unmatched_tracks:
64 self.tracks[track_idx].mark_missed()
65 for detection_idx in unmatched_detections:
66 self._initiate_track(detections[detection_idx], classes[detection_idx].item())
67 self.tracks = [t for t in self.tracks if not t.is_deleted()]
68
69 # Update distance metric.
70 active_targets = [t.track_id for t in self.tracks if t.is_confirmed()]
71 features, targets = [], []
72 for track in self.tracks:
73 if not track.is_confirmed():
74 continue
75 features += track.features
76 targets += [track.track_id for _ in track.features]
77 track.features = []
78 self.metric.partial_fit(
79 np.asarray(features), np.asarray(targets), active_targets)
80
81 def _match(self, detections):
82

Callers 1

updateMethod · 0.45

Calls 6

_matchMethod · 0.95
_initiate_trackMethod · 0.95
mark_missedMethod · 0.80
is_deletedMethod · 0.80
is_confirmedMethod · 0.80
partial_fitMethod · 0.80

Tested by

no test coverage detected