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

Function linear_assignment

yolox/sort_tracker/sort.py:25–33  ·  view source on GitHub ↗
(cost_matrix)

Source from the content-addressed store, hash-verified

23
24
25def linear_assignment(cost_matrix):
26 try:
27 import lap
28 _, x, y = lap.lapjv(cost_matrix, extend_cost=True)
29 return np.array([[y[i],i] for i in x if i >= 0]) #
30 except ImportError:
31 from scipy.optimize import linear_sum_assignment
32 x, y = linear_sum_assignment(cost_matrix)
33 return np.array(list(zip(x, y)))
34
35
36def iou_batch(bb_test, bb_gt):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected