ultralytics 8.0.51 add assets and CI actions (#1296)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Paul Kehrer <paulhkehrer@gmail.com>
This commit is contained in:
Glenn Jocher
2023-03-07 20:25:10 +01:00
committed by GitHub
parent f0d8e4718b
commit 790f9c067c
21 changed files with 272 additions and 107 deletions

View File

@ -40,7 +40,10 @@ def linear_assignment(cost_matrix, thresh):
if cost_matrix.size == 0:
return np.empty((0, 2), dtype=int), tuple(range(cost_matrix.shape[0])), tuple(range(cost_matrix.shape[1]))
matches, unmatched_a, unmatched_b = [], [], []
# TODO: investigate scipy.optimize.linear_sum_assignment() for lap.lapjv()
cost, x, y = lap.lapjv(cost_matrix, extend_cost=True, cost_limit=thresh)
matches.extend([ix, mx] for ix, mx in enumerate(x) if mx >= 0)
unmatched_a = np.where(x < 0)[0]
unmatched_b = np.where(y < 0)[0]