rework of teamassigner to use kmeans clustering#41
Merged
isacpaulsson merged 6 commits intomainfrom Dec 8, 2025
Merged
Conversation
…ded outlier check for short lived ids (crowd can massively skew feature distribution)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reworked teamassigner to use kmeans clustering instead of clip.
Features are binned hsv values (h:8, s:4, v:4) -> yeilding a vector with 128 features per bounding box and frame.
All features for same player id are averaged into a single feature representation (over time).
This results in one feature vector for each unique player id that is then clustered using kmeans.
rare ids are filtered (need exist for more than 3 frames), single crowd detection can be a massive outlier in color feature space.
success (all three initial test videos succeed):
https://github.com/user-attachments/assets/ca910659-563a-4f92-be3f-f2839ce75f63
failure (one id missclassified) Likely due to ID switch between 7 and 5:
https://github.com/user-attachments/assets/d497cc1d-0438-406e-9209-7adc52ceb3e8
failure (multiple ids missclassified) likely due to frequent id switching during the clip:
https://github.com/user-attachments/assets/422abe88-151f-42be-b20c-82917e103f11
Closes #12
Closes #34
Updated plots and video generation, color is extracted from kmeans for the team clusters and is used when drawing videos and plots.