Work in progress. Core pipeline is functional but the UI needs significant work. Not production-ready.
Computer vision and tactical analytics for broadcast soccer footage.
Live demo: coming soon
Upload or select a broadcast clip. The pipeline:
- Detects players, goalkeepers, referees, and the ball using YOLOv8m
- Tracks each entity across frames with ByteTrack (persistent IDs)
- Maps pixel positions to real pitch coordinates via homography estimation
- Assigns teams via KMeans clustering on torso HSV colors
- Computes per-frame formation (3- or 4-line KMeans on pitch depth)
- Computes pressing intensity (0–100 score based on nearest opponents to ball carrier)
- Computes Voronoi space control (% of pitch controlled per team)
- Aggregates everything into a tactical dashboard
| Layer | Tech |
|---|---|
| Detection | YOLOv8m (Ultralytics) |
| Tracking | ByteTrack via boxmot |
| Homography | OpenCV (HSV line detection + RANSAC) |
| Analytics | NumPy, SciPy, scikit-learn, Shapely |
| Backend | FastAPI + SSE streaming |
| Frontend | React 18 + Vite, plain CSS modules |
| Deployment | HuggingFace Spaces (backend) + Vercel (frontend) |
cd backend
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000cd frontend
npm install
npm run dev # http://localhost:5173cd backend
python model/train.py --epochs 50 --batch 16Five broadcast clips are pre-loaded in backend/demo_clips/:
| ID | Match |
|---|---|
possession |
Possession sequence |
pressing |
High-press sequence |
open_play |
Chelsea vs Arsenal |
transition |
Tottenham vs Watford |
ucl |
Liverpool vs PSG (UCL) |
- Backend: HuggingFace Spaces (Docker) — see
backend/Dockerfile - Frontend: Vercel — set
VITE_API_URLto your HF Space URL
Work in progress