Skip to content

Commit

Permalink
Fix deprecated sklear linear_assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
jimtang123 committed Jul 22, 2022
1 parent 280b8bd commit f9de9ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions deep_sort/linear_assignment.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vim: expandtab:ts=4:sw=4
from __future__ import absolute_import
import numpy as np
from sklearn.utils.linear_assignment_ import linear_assignment
from scipy.optimize import linear_sum_assignment as linear_assignment
from . import kalman_filter


Expand Down Expand Up @@ -55,7 +55,8 @@ def min_cost_matching(
cost_matrix = distance_metric(
tracks, detections, track_indices, detection_indices)
cost_matrix[cost_matrix > max_distance] = max_distance + 1e-5
indices = linear_assignment(cost_matrix)
r_ind, c_ind = linear_assignment(cost_matrix)
indices = np.vstack((r_ind, c_ind)).T

matches, unmatched_tracks, unmatched_detections = [], [], []
for col, detection_idx in enumerate(detection_indices):
Expand Down

0 comments on commit f9de9ac

Please sign in to comment.