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

Negative Values #121

Open Auth0rM0rgan opened 3 years ago

Auth0rM0rgan commented 3 years ago

Hey @abewley,

Sometimes I'm getting negative values for BBox coordinates after the tracker update. Sometimes in x1, sometimes in x2. This is the output of object_tracker.update in my code Screenshot from 2020-11-04 13-09-46 I'm passing the list to the tracker with x1, y1, x2, y2, conf bbox.append([x1, y1, x2, y2, conf]) and I'm calling the update tracker like below:

        if len(det_info) == 0:
            bbox = np.empty((0, 5))
        else:
            bbox = np.array(det_info)
        track = self.object_tracker.update(det_info)
        for i in range(track.shape[0]):
            xx1, yy1, xx2, yy2, score = (int(x) for x in track[i, :])
            c1, c2 = (xx1, yy1), (xx2, yy2)
            cv2.rectangle(frame0, c1, c2, (0, 255, 0), 2)
        cv2.imshow('with Sort', frame0) 

I have set the max_age=5, min_hits=1, and iou_threshold=0.3. Also, I'm not seeing any difference between applying sort and not applying sort! I mean with or without sort the results are the same (with max_age=5 I'm supposed to keep the detection for 5 frames even if I lose the detection but not working...) Can you help me with what I'm doing wrong? Any help will be appreciated

Thanks!!

TECOLOGYxyz commented 3 years ago

I am having this same issue with negative values for updated bounding box coordinates, but I am getting negative values for y. I am applying the script for the command line. I'm using the latest version of the code and I am inputting x,y,w,h (x,y for upper left point). A whole row of input data looks like this:

1,-1,3817,926,277,251,1,-1,-1,-1

Does one need to specify the format of the input (x1,y1,x2,y2 or x,y,w,h)?