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

StrongSORT for known fixed number of objects to track #75

Closed
ChrCoello opened this issue Feb 20, 2023 · 3 comments
Closed

StrongSORT for known fixed number of objects to track #75

ChrCoello opened this issue Feb 20, 2023 · 3 comments

Comments

@ChrCoello
Copy link

ChrCoello commented Feb 20, 2023

Hi,
I have a use case where I know the amount of objects to track at all time (N). There can be occlusions, but if waiting long enough, the objects we track will always reappear. I am trying to understand how to modify StrongSORT / SORT tracker to not create new tracks . I initialise the tracks with a certain number of frames where I know all N objects are visible.

The first try was to impeach the creation of any track after the first:
Line 103 of tracker.py

for detection_idx in unmatched_detections:
    if self._next_id < (self.n_init+1):
        self._initiate_track(detections[detection_idx], classes[detection_idx].item(), confidences[detection_idx].item())

But this seems to be too stringent, as I only get 2 tracks as output, instead of N.

I see that some discussions in the SORT page relate to this, but there is no clear answer/tip into how to implement (abewley/sort#157).

Any help is very appreciated, thanks in advance.

@dyhBUPT
Copy link
Owner

dyhBUPT commented Feb 20, 2023

Hi, that's a new problem for me.

I may suggest the following methods upon StrongSORT:

  1. Limit the number of tracks matched or initialized per frame using N. For example N=5, at frame t, you have 3 tracked tracks and 3 new detections. Then you should delete one detection.
  2. Becasue objects will always reappear, you can add an extra matching procedure, which only uses appearance information.

Best wishes.

@ChrCoello
Copy link
Author

@dyhBUPT very useful answer. I just had some time to implement the point 1. I indeed now only get N tracks, which is what I hoped to achieve.
I am still trying to understand the point 2. of your answer, but for this I need to read more details about DeepSORT / StrongSORT.
Thanks again for your answer.

@dyhBUPT
Copy link
Owner

dyhBUPT commented Feb 24, 2023

Glad to hear that~

@dyhBUPT dyhBUPT closed this as completed Feb 24, 2023
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

2 participants