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

Add support for limiting the number of instances in a video #1072

Closed
2 tasks done
westlinkin opened this issue Mar 29, 2024 · 3 comments
Closed
2 tasks done

Add support for limiting the number of instances in a video #1072

westlinkin opened this issue Mar 29, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@westlinkin
Copy link

Search before asking

  • I have searched the Supervision issues and found no similar feature requests.

Description

Currently, the Supervision library provides tools for tracking objects in a video, but there is no built-in support for limiting the number of instances. This can be useful in scenarios where we want to restrict the number of detections for a particular class, for example, in a football video, we want to limit the number of players to 22 maximum, for any given time, there are maximum 22 players on the field, so there should not be a no.23 tracker id.

because there are collisions of players in the video, so there will be mistracking happening. if a no.23 tracker id appears, and a no.10 tracker id disappears, and the distance of the two players are relatively close, then it's saft to say no.10 becomes no.23, we need to update tracker id 23 to 10.

Use case

This is particularly useful to track players on a sports field.

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@westlinkin westlinkin added the enhancement New feature or request label Mar 29, 2024
@SkalskiP
Copy link
Collaborator

Hi @westlinkin 👋🏻, I'm not sure how we would implement such logic. If the model detects 23 people, not 22, how do you know which of those players is a double detection?

@westlinkin
Copy link
Author

@SkalskiP we can drop the 23rd people if no.23 'suddenly' appears in the middle of the video. if there are 23 people in the beginning, we can just drop the lowest confidence one.

I created a tool to limit the max tracking instances, but I am still testing it, if it is good enough, I will submit a PR

@SkalskiP
Copy link
Collaborator

SkalskiP commented Apr 5, 2024

Hi @westlinkin 👋🏻 Thank you very much for your interest in Supervision as well as the time you spent preparing this PR. After careful analysis, I have decided to side with @LinasKo's comments and not merge this PR. I share a similar opinion - it seems to me that this tool is not universal enough. I know it works in the case you described, but nevertheless, I believe its place is not in Supervision. Thank you once again for the time invested.

@SkalskiP SkalskiP closed this as completed Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants