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

distance_metric callback #230

Open Eyshika opened 3 years ago

Eyshika commented 3 years ago

Where can i find the defnition for distance_metric which is callable in linear assignment ? @nwojke @kinnzo @linuxandchill @abewley @iory

studentbrad commented 3 years ago

It is not a "callback", it is a "callable", as in a function. I'm guessing the definition in the code does not suffice? https://github.com/nwojke/deep_sort/blob/280b8bdb255f223813ff4a8679f3e1321b08cdfc/deep_sort/linear_assignment.py#L18 If you want a better definition I suggest reading the publication which goes over this quite explicitly. https://arxiv.org/abs/1703.07402

If you want my definition, it generates a cost matrix from tracks to detections, NxM in size. Tracks of size N, detections of size M. The cost matrix is a weighted sum between the gating distance and cosine distance (or gating distance and IOU for unmatched tracks). The function takes four parameters: tracks, detections, track_indices (size M) and detection indices (size N).