Skip to content

feat: add PASS_NETWORK ball possession and collaboration overlays (PR 7) - #66

Open
AlexBodner wants to merge 8 commits into
feat/soccer-pr6-goal-shadingfrom
feat/soccer-pr7-pass-network
Open

feat: add PASS_NETWORK ball possession and collaboration overlays (PR 7)#66
AlexBodner wants to merge 8 commits into
feat/soccer-pr6-goal-shadingfrom
feat/soccer-pr7-pass-network

Conversation

@AlexBodner

@AlexBodner AlexBodner commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Ball attach + cache, possession/pass scan, and collaboration aggregation on VideoTrackingSession
  • New Mode.PASS_NETWORK (opt-in; not in ALL) with carrier/pass/turnover overlays, radar minimap, and a short top-collaborators end-card
  • Lane quality / pass_options deferred to PR8 (PassQualityScorer is a no-op here; detection does not gate on scores)

Ball tracking here uses the dedicated ball YOLO only (football-ball-detection.pt). We are not adding a fallback that fills gaps with player-detector ball boxes when the dedicated model drops mid-flight — that helped recall on some hard clips in earlier experiments, but it adds a second ball path and caching story we do not want in this PR. If dedicated-ball gaps become a real issue in production demos, it can be a focused follow-up.

Demo

PASS_NETWORK — ball attach, pass/turnover overlays, collaboration arcs, and end-card (clip: 10 passes, 1 turnover on the sample video):

All demos

Run

cd examples/soccer
python main.py \
  --source_video_path data/08fd33_0.mp4 \
  --target_video_path data/renders/pr7-pass-network.mp4 \
  --device mps --mode PASS_NETWORK \
  --ball-model-path data/football-ball-detection.pt

Requires ball weights from ./setup.sh. Prefer a full clip for meaningful pass recall. Analytics default tracker is botsort (--tracker bytetrack / botsort_nocmc available).

Test plan

  • --mode PASS_NETWORK renders without crash; ball attaches when detected
  • Passes/turnovers overlay; end-card shows top collaborators when passes exist
  • Quality fields on inferred passes may be null (scoring is PR8)
  • DIRECTION / SPEED / DISTANCE / ALL unchanged
  • Legacy BALL_DETECTION unchanged

@AlexBodner

Copy link
Copy Markdown
Collaborator Author

Cleanup: moved image_displacement_to_pitch_m into homography (SPEED no longer imports pass_pitch), prefer forward RANSAC, python_requires>=3.9.

@AlexBodner
AlexBodner force-pushed the feat/soccer-pr6-goal-shading branch from 90642f0 to 41e1b2d Compare July 21, 2026 17:05
AlexBodner and others added 8 commits July 22, 2026 13:03
…ation overlays (PR7).

Ports pass inference into sports/common, wires session pass_frames/pass_scan, and ships an opt-in mode with carrier highlights, pass arrows, and a short end-card.

Co-authored-by: Cursor <cursoragent@cursor.com>
…o-op.

Pass detection never gated on lane scores — only decoration. Dropping
pass_options.py and corridor geometry keeps PASS_NETWORK reviewable without
the alternatives stack.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keeps SPEED independent of pass_pitch and matches the Copilot RANSAC note.

Co-authored-by: Cursor <cursoragent@cursor.com>
Align with PR1 review cleanup so the stack tip matches declared support.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ring.

Detect passes/turnovers without quality decoration; credit possession under
pending opponent releases; tighten transit/gravity fly-by gates. Collaboration
aggregates stay count-only so PR8 can add alternatives scoring once.

Co-authored-by: Cursor <cursoragent@cursor.com>
Speed-only redirects let teammate fly-bys (e.g. #15#8 on 08fd33) complete a
pass before the real interceptor settles; require a deflection angle so the
turnover attributes to #3.

Co-authored-by: Cursor <cursoragent@cursor.com>
A one-frame ball teleport near an opponent after #3#25 was minting a
one-touch release that fly-by-vetoed the return pass; only allow that promote
while the opponent release is still in-flight (real intercepts).

Co-authored-by: Cursor <cursoragent@cursor.com>
Drop dead opponent-gap helpers and unused possession imports with no
callers. Behavior unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@AlexBodner
AlexBodner force-pushed the feat/soccer-pr7-pass-network branch from 0646317 to a0e2eba Compare July 22, 2026 16:07
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

Successfully merging this pull request may close these issues.

1 participant