r/computervision • u/Ok-Pride-6845 • 45m ago
Help: Project Im trying to get highlights from a soccer game for the selected player.
Hey, ive been trying as title but my pipeline is not giving accurate clips. It sometimes selects the wrong player or sometimes it select the right player just walking which should not be a highlight.
Im gonna add my full pipeline using Grok Bot
Also i have not worked before as ai vision engineer so i have no idea what im doing im just making progress step by step solving one problem at a time with ultra grok subscription.
here is the pipeline image.
And below is the code architecture structured using AI(sorry!!)
—————-
I'm building a pipeline where a user clicks one player once in a full-match video (single wide camera, amateur/youth games, 90+ min). It should output a highlight reel of that player's on-ball actions, matching what a human editor would cut.
Current live pipeline (one RTX 6000 Ada, 48 GB):
Detection: YOLO for players and ball.
Tracking: a ByteTrack-style tracker splits the match into thousands of short tracklets. A ViT-B ReID model (SoccerNet) splits tracklets that drift onto another player.
Team and kit: colour clustering over the tracklets assigns a team. The user also types the kit colour.
Jersey number: Florence-2 reads first, then Qwen2.5-VL-7B gives a second opinion on selected crops. A readability scorer picks which crops to read.
Identity linking: tracklets with a confirmed number become anchors. A class-balanced logistic regression on appearance, kit and time features links other tracklets to the clicked player. Tracklets that overlap an anchor in time are used as negatives, since a player can't be in two places at once.
Ball and touches: ball detection plus a touch/control heuristic produces candidate events near the player's feet.
Clip selection: events are merged into clips (capped), scored, and cut into the reel.
Measured on hand-made answer keys (the editor's reels mapped back to the match), with the click simulated from the key:
Game A: live settings catch 25/47 moments at 57% clip precision. With better identity it would be 39/47, but only with jersey reads no live run has.
Game B: 14/20 moments at 25% precision.
Game C: 4–5/11 at 6–8%. The editor's reel is a 69 s "best of", and ours is 700+ s.
What we've found so far:
Ball: RF-DETR-L fine-tuned on SoccerNet finds 22/28 balls on our 100-frame labelled set, against 7/28 for YOLO, and raises moments found a lot. WASB was unusable on this footage.
Jersey: about 93% of crops are unreadable, because players are often under 60 px tall. Florence-2 reads "7" as "1" on half the crops. Choosing crops by readability, then using the VLM, doubles the confirmed pieces with no false reads.
The real bottleneck is which tracklets get read at all: 15 of 38 true tracklets are never sent to OCR because of size limits, the kit-colour filter and the budget. On one game, the colour labeller called a black kit "orange", which filtered out almost all of the player's tracklets.
Linking: more anchors bring many more time-overlap negatives, so a fixed threshold links less. Setting the threshold to a fixed false-link rate, cross-validated on each game's own anchors and negatives, took Game A from 25/47 to 32/47 with zero wrong-player clips.
Precision: much of the clip-precision gap is that editors leave out many real touches. "Did the player touch the ball" and "would an editor keep it" are different problems.
What I'm planning next:
Test the fixes across several more answer-key games before trusting any single-game gain.
Kit matching from the clicked player's measured appearance instead of a colour name.
Spatio-temporal chaining from confirmed anchors to decide what to read.
A touch/action ranker trained leave-one-game-out, to match "best of" reels.
Possibly RF-DETR for player detection as well as the ball.
Questions for people who've done sports CV:
For a single wide camera, what works best for long-term identity of one player through occlusions and off-screen gaps? Global tracklet association (graph or min-cost flow), game-specific ReID fine-tuning, or something else?
Any open jersey-number recognisers that hold up on low-resolution broadcast or amateur footage? I'm looking at PARSeq fine-tuned on SoccerNet jersey crops.
For ranking "highlight-worthy" actions, has anyone used SoccerNet action spotting models (or similar) on amateur footage successfully?
Better ways to tell a real touch from the ball just passing near a player with only one camera?
Happy to share more numbers or failure cases.