nwojke / deep_sort

Simple Online Realtime Tracking with a Deep Association Metric
GNU General Public License v3.0
5.27k stars 1.47k forks source link

update for latest sklearn #220

Open yasutomo57jp opened 4 years ago

gndowns commented 3 years ago

Seconding this. Reference here: https://stackoverflow.com/questions/62390517/no-module-named-sklearn-utils-linear-assignment

danielcrane commented 2 years ago

Thirding this, however I'd personally recommend changing it to be something more like the following to avoid the unnecessary np.vstack().T:

from scipy.optimize import linear_sum_assignment
   indices_rows, indices_cols = linear_sum_assignment(cost_matrix)

    matches, unmatched_tracks, unmatched_detections = [], [], []
    for col, detection_idx in enumerate(detection_indices):
        if col not in indices_cols:
            unmatched_detections.append(detection_idx)
    for row, track_idx in enumerate(track_indices):
        if row not in indices_rows:
            unmatched_tracks.append(track_idx)
    for row, col in zip(indices_rows, indices_cols):