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

Function fuse_motion

yolox/tracker/matching.py:145–156  ·  view source on GitHub ↗
(kf, cost_matrix, tracks, detections, only_position=False, lambda_=0.98)

Source from the content-addressed store, hash-verified

143
144
145def fuse_motion(kf, cost_matrix, tracks, detections, only_position=False, lambda_=0.98):
146 if cost_matrix.size == 0:
147 return cost_matrix
148 gating_dim = 2 if only_position else 4
149 gating_threshold = kalman_filter.chi2inv95[gating_dim]
150 measurements = np.asarray([det.to_xyah() for det in detections])
151 for row, track in enumerate(tracks):
152 gating_distance = kf.gating_distance(
153 track.mean, track.covariance, measurements, only_position, metric='maha')
154 cost_matrix[row, gating_distance > gating_threshold] = np.inf
155 cost_matrix[row] = lambda_ * cost_matrix[row] + (1 - lambda_) * gating_distance
156 return cost_matrix
157
158
159def fuse_iou(cost_matrix, tracks, detections):

Callers

nothing calls this directly

Calls 2

to_xyahMethod · 0.45
gating_distanceMethod · 0.45

Tested by

no test coverage detected