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

Function _indices_to_matches

tutorials/ctracker/mot_online/matching.py:39–47  ·  view source on GitHub ↗
(cost_matrix, indices, thresh)

Source from the content-addressed store, hash-verified

37
38
39def _indices_to_matches(cost_matrix, indices, thresh):
40 matched_cost = cost_matrix[tuple(zip(*indices))]
41 matched_mask = (matched_cost <= thresh)
42
43 matches = indices[matched_mask]
44 unmatched_a = tuple(set(range(cost_matrix.shape[0])) - set(matches[:, 0]))
45 unmatched_b = tuple(set(range(cost_matrix.shape[1])) - set(matches[:, 1]))
46
47 return matches, unmatched_a, unmatched_b
48
49
50def linear_assignment(cost_matrix, thresh):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected