Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SORT ID for new detection between other old detections #165

Open
HeChengHui opened this issue Jan 19, 2023 · 0 comments
Open

SORT ID for new detection between other old detections #165

HeChengHui opened this issue Jan 19, 2023 · 0 comments

Comments

@HeChengHui
Copy link

HeChengHui commented Jan 19, 2023

image
Assume a scenario where SORT tracks by giving 2 IDs to 2 detections as shown.

image
now there is a new detection in blue, SORT returns tracking ID in this sequence. How do i get 1,3,2 instead of 1,2,3 shown?

# SORT parameters
max_age = 300  # Maximum number of frames to keep alive a track without associated detections
min_hits = 0  # Minimum number of associated detections before track is initialised; 0 so any new detections also counted as a track
iou_threshold = 0.3  # Minimum IOU for match
# create instance of the SORT tracker
sort_tracker = sort.Sort(max_age=max_age, 
                       min_hits=min_hits,
                       iou_threshold=iou_threshold) 

faces = detection.get(frame)
faces = sorted(faces , key = lambda x : x.bbox[0])
dets = np.asarray([np.append(face['bbox'].astype(int).tolist(), face['det_score']).tolist() for face in faces])
track_bbs_ids = sort_tracker.update(dets)

==================
Update: I realised that passing all the detections into SORT to update gives a sorted list based on their tracking ID. Is there a way to have them be arranged based on the order of detections instead? Besides passing detections into SORT update 1-by-1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant