adipandas / multi-object-tracker

Multi-object trackers in Python
https://adipandas.github.io/multi-object-tracker/
MIT License
676 stars 100 forks source link

Tracking one object when no object detected #21

Closed talha0324 closed 3 years ago

talha0324 commented 3 years ago

Hey. so I have these bounding boxes, confidence, classes as empty, when I send it to update function. I get 1 object as being tracked. I'm using SORT(..) object.

image

adipandas commented 3 years ago

I was not able to reproduce this error. I tried as you are showing here. It is likely, you created this instance of object tracker before and used it for some detection and tracking. Later, you may have used the same tracker instance by passing empty data. It is likely that you are getting the buffer values from previous data.

I ran the following code:

def main(tracker):
    for i in range(1000):
        bboxes, confidences, class_ids = np.array([]), np.array([]), np.array([])
        tracks = tracker.update(bboxes, confidences, class_ids)
        print(tracks)

tracker = SORT(max_lost=3, tracker_output_format='mot_challenge', iou_threshold=0.3)
main(tracker)

I got the following output:

[]
[]
[]
[]
...