nwojke / deep_sort

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

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

Open tannd-ds opened 6 months ago

tannd-ds commented 6 months ago

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

image

FlyingPotato437 commented 3 months ago

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))