Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update deprecated code (linear_assignment and np's type) #323

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tannd-ds
Copy link

@tannd-ds tannd-ds commented Jan 4, 2024

  • the linear_assignment from scikit-learn is deprecated and has been removed, instead, now we use linear_sum_assignment from scipy.optimize. The two functions have slightly different return types and I did adjust the code so that it worked as it was.
  • Many type casting in the project are deprecated (like np.int is no longer used, instead we use int or specify the precision like np.int32).

I've already tested it and now it runs perfectly without any errors.

image

@FlyingPotato437
Copy link

I agree, should be replacing the cost matrix functino with this:
cost_matrix = distance_metric(tracks, detections, track_indices, detection_indices)
cost_matrix[cost_matrix > max_distance] = max_distance + 1e-5

Use linear_sum_assignment from scipy.optimize

row_indices, col_indices = linear_sum_assignment(cost_matrix)
indices = list(zip(row_indices, col_indices))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants