MotionCast

Pro-grade game-film analysis across sports — for the teams that could never afford it.

Inspiration

Team sports are played everywhere, but tactical analysis is a luxury — pro clubs pay six figures for analytics platforms and analysts. Amateur, college, and youth teams film every game, then that footage just sits there. The teams with the most to learn have the least access to the tools that teach it. We set out to prove the foundational layer of sports analytics — knowing where every player is, every frame — could be built for free, shown to be correct, and work across sports.

What it does

MotionCast is an analyst's workspace for game film, built for multiple sports. You upload match video, pick your sport — soccer, basketball, or American football — and it automatically detects and tracks every player, plus the ball, casting them onto a 2D top-down view. It adds team differentiation, ball possession, and motion trails, then surfaces everything in a club dashboard (xG, win probability, pressing intensity, matchups).

We've tracked real footage across all three sports with the same pipeline. Accuracy is rigorously validated on soccer: we score our tracking against professional ground-truth annotations with a real HOTA number, so the data feeding every view is measurably trustworthy.

What's real today: the React frontend, multi-sport player + ball tracking (soccer, basketball, football), team/possession/trails, and HOTA-validated accuracy on soccer. The dashboard's predictive models (xG, win-prob) are the next layer on top of the tracking we've proven.

How we built it

  • Frontend: a React/Vite analyst app — landing → guided film upload (file → sport → game details → review) → dashboard, in a dark lime-accent theme. Sport selection drives the labels and models.
  • Tracking: built on SAM 3.1 (HF Transformers) for segmentation/tracking, plus a Roboflow-sports-based pipeline for ball tracking, team differentiation (color clustering), possession, and motion trails. The same model tracks people and the ball regardless of sport — which is why basketball and football work without sport-specific rewrites.
  • Swappable backend: everything depends only on an abstract SamBackend interface, with a hosted SAM path and a no-GPU GSR-replay backend that runs the whole pipeline on a laptop and acts as a "perfect tracker" upper bound ($\text{HOTA}\approx 1.0$) to sanity-check the eval.
  • Data + detector validation: a self-contained reader for SoccerTrack v2's GSR annotations (COCO, ~2.6 GB/match) and a GSR → YOLOv5 converter + Colab run to prove the data was sound, with labels normalized as $x_c=\frac{x+w/2}{W},\ y_c=\frac{y+h/2}{H}$ and panorama-aware augmentation.
  • Eval: we never reimplement metrics — we shell out to the official GSR-HOTA scorer, where $\text{HOTA}=\sqrt{\text{DetA}\cdot\text{AssA}}$ balances detection against identity consistency over time.

Challenges we ran into

  • A coordinate-space rabbit hole: GSR boxes floated in the sky above the pitch. The cause wasn't math — panorama_2nd is a substring of calibrated_panorama_2nd, so we were silently drawing correct boxes on the wrong (calibrated) video. Fixed with an explicit exclude filter.
  • Drive download quotas on the multi-GB files — worked around by mounting our own Drive in Colab.
  • No GPU, huge 4K video, ephemeral Colab — handled with deferred imports, strided sampling, a hosted backend, and the no-GPU replay path.

Accomplishments that we're proud of

A polished React analyst UI; multi-sport tracking demonstrated across soccer, basketball, and football with one pipeline; ball tracking, team differentiation, possession, and trails; HOTA-validated accuracy with an eval harness that never fabricates a number; and a subtle data bug debugged honestly instead of papered over.

What we learned

Tracking is the hard, foundational part of analytics — and proving it with HOTA matters more than a shallow feature. A well-chosen tracking foundation generalizes: the same model that tracks a soccer pitch tracks a basketball court and a football field. Validate the data before the model — our overlay checks caught a coordinate bug that would've trained YOLO on grass and sky. And $\text{HOTA}=\sqrt{\text{DetA}\cdot\text{AssA}}$ forced us to care about identity over time, not just per-frame detection — the association problem every sport shares.

What's next for MotionCast

Wire the dashboard's predictive models (xG, win probability, pressing) onto the tracked coordinates we already produce; ground-truth accuracy eval for basketball and football (soccer has it today); a calibrated homography minimap; and event spotting for auto-highlights — all toward one goal: pro-grade film analysis any team, in any sport, can run on their own footage, free.

Built With

Share this project:

Updates