Inspiration

Grassroots coaches rarely have a dedicated tactical analyst. I wanted Gaffer to spot meaningful formation changes from match video while avoiding noisy alerts. Shadows, camera drift and crowded set pieces can all look like a change, so Gaffer treats every detection as a candidate that must be checked again.

What it does

Gaffer analyses top-down drone or high fixed-camera football video. OpenCV detects and tracks players, identifies teams by shirt colour and maps their positions onto a 2D pitch. It reads formations over 30-second windows and flags changes such as White switching from 4-4-2 to 3-4-3.

For each candidate, Gaffer checks camera quality and can reanalyse the video window at a higher frame rate. It confirms, rejects or marks the change uncertain. A confirmed alert shows an annotated frame and before-and-after shapes; the coach then approves or rejects it.

How we built it

OpenCV 5 handles pitch calibration, player detection, tracking, team colours, camera drift and evidence images. Python and FastAPI run the analysis; React powers the interface. The app runs on Amazon EC2, with Amazon Bedrock Nova 2 Lite orchestrating the verification tools and explaining results. Deterministic rules make the final verification decision; the model does not see video pixels. Claude Code and Codex assisted implementation, while I directed the design, testing and evaluation.

Challenges we ran into

Players can disappear from view during set pieces, and long shadows caused false detections on a second pitch. Per-video calibration improved detection F1 there from 0.567 to 0.855. We also found that the language model did not improve the rules' decisions, so we kept its role focused on orchestration and explanation.

Accomplishments that we're proud of

On 10 held-out synthetic matches, verification reduced false alerts from 34 to 9 while retaining 32 of 38 real changes. On real drone footage, Gaffer confirmed White's 4-4-2 to 3-4-3 change at 16:30 with visual evidence. Coaches remain in control of every alert.

What we learned

A useful analyst needs to say “uncertain” when the video is weak. Testing on another ground exposed problems that one match could not reveal. Measuring the rules separately from the language model also showed which part actually reduced false alerts.

What's next for Gaffer

Test more pitches and camera heights, improve the missed return-leg change, add reliable ball tracking, and make 4K analysis faster. A true live-camera mode is future work; today's live-analysis screen replays a recorded match.

Share this project:

Updates

Submission history