deep_sort
deep_sort copied to clipboard
Module Error?
When I execute "python deep_sort_app.py -h" in cmd
error is "Traceback (most recent call last):
File "deep_sort_app.py", line 14, in
C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\sklearn\utils\linear_assignment_.py:21: DeprecationWarning: The linear_assignment_ module is deprecated in 0.21 and will be removed from 0.23. Use scipy.optimize.linear_sum_assignment instead. DeprecationWarning)
so you should reinstall a lower sklearn
from scipy.optimize import linear_sum_assignment as linear_assignment
# indices = linear_assignment(cost_matrix)
row_indices, col_indices = linear_assignment(cost_matrix)
matches, unmatched_tracks, unmatched_detections = [], [], []
for col, detection_idx in enumerate(detection_indices):
if col not in col_indices:
unmatched_detections.append(detection_idx)
for row, track_idx in enumerate(track_indices):
if row not in row_indices:
unmatched_tracks.append(track_idx)
for row, col in zip(row_indices, col_indices):
track_idx = track_indices[row]
detection_idx = detection_indices[col]
if cost_matrix[row, col] > max_distance:
unmatched_tracks.append(track_idx)
unmatched_detections.append(detection_idx)
else:
matches.append((track_idx, detection_idx))