abewley / sort

Simple, online, and realtime tracking of multiple objects in a video sequence.
GNU General Public License v3.0
3.82k stars 1.07k forks source link

format for dets (too many indices for array) #96

Closed GOBish closed 4 years ago

GOBish commented 4 years ago

I am trying to use my object identifier (a tensorflow model) to create the detections for SORT but I am having some trouble formatting it correctly.

I am following the advice in https://github.com/kedpter/track_face_example/blob/master/track_face_example.py from https://github.com/abewley/sort/issues/72

with something similar:

dets_list = [l, t, r, b, 1]  #I get this from the output of my detector
dets = np.array(dets_list)

trackers = mot_tracker.update(dets)

however when I do this I get an error from SORT

IndexError: too many indices for array trk=KalmanBoxTracker(dets[i,:])

Note this is when there is only one detection in the frame - i think that may be causing the issue.

GOBish commented 4 years ago

Ahh, just had to add another bracket.

dets_list = [[l, t, t, b, 1]]