Closed Varat7v2 closed 3 years ago
I meet the same problem with you ,have you solved it? Thanks very much!
I added this line:
dets = np.array(dets)
right after update:
def update(self, dets=np.empty((0, 5))):
Maybe worked for me
Can you please provide more information on how to reproduce this error? Are you passing dets as a 2D numpy array following what is described in the update() doc string? If not you can easily create a numpy array as pilarpe4@ described.
i changed the whole sort file, copy pasted from original doc, attaching file for that i am using, sort_copied.txt
for x1, y1, x2, y2, obj_id, cls_pred in tracked_objects: (so this sort will return bbox coordinates, id and cls)
i changed the whole sort file, copy pasted from original doc, attaching file for that i am using, sort_copied.txt
for x1, y1, x2, y2, obj_id, cls_pred in tracked_objects: (so this sort will return bbox coordinates, id and cls)
How do I go about using this new file? What I have done is I have copied and pasted the txt file into the sort.py file, and re-ran the application. This still gives me the error :
File "<root-repo>\sort.py", line 216, in update
trk = KalmanBoxTracker(dets[i,:])
TypeError: list indices must be integers or slices, not tuple
i changed the whole sort file, copy pasted from original doc, attaching file for that i am using, sort_copied.txt for x1, y1, x2, y2, obj_id, cls_pred in tracked_objects: (so this sort will return bbox coordinates, id and cls)
How do I go about using this new file? What I have done is I have copied and pasted the txt file into the sort.py file, and re-ran the application. This still gives me the error :
File "<root-repo>\sort.py", line 216, in update trk = KalmanBoxTracker(dets[i,:]) TypeError: list indices must be integers or slices, not tuple
I tried this, again, its working, as far as i can remember i got this error while updating something in those files. just find out what is the type of detections, i am pasting my piece of code that is invoking tracker. and type of detections and tracked_objects
** detections=detections.type(torch.DoubleTensor)
tracked_objects = mot_tracker.update(detections)
detectionstest.append(detections)
box = detections[0:4]**
type(detections) Out[2]: torch.Tensor
type(tracked_objects) Out[3]: numpy.ndarray
and can you try this sort code, on a different pc ? i think you might have to reinstall some stuff. ( just a wild guess)
the input to update() must be an np array rather than list of lists
I am trying to use SORT in my project, but I am getting following error. I am trying to track the error but not able to find why its occurring.