Basketball Tracking System
- #Object Detection
- #Sports
A basketball tracking system for a US sports analytics company. It detects every player and the ball in ordinary gym footage, keeps identities stable through screens, and turns the video into speed, spacing and shot data for coaches the same night.
- Computer Vision
- Data Analysis
Impact
The client is a US sports analytics company selling video breakdowns to college programs, high schools and club teams. Analysts tagged every game by hand: 6 to 8 hours a game, about 12 games a week, stats reaching coaches 3 to 4 days later, and growth capped at 40 teams.
We built a pipeline that works from one ordinary gym camera: RT-DETR detection, a ReID tracker, a jersey-color team classifier and court homography. It sends about 40 metrics per player per game to a web dashboard and a React Native app.
Services we provided
Feasibility Study on Real Footage
Data Annotation
Detection and ReID Model Fine-Tuning
GPU Pipeline and Node.js API
Coach Web Dashboard
React Native Mobile App
QA, Pilot and Rollout
Tech Stack
Python
Pytorch
Challenges and Solutions
🧐 Challenges
- Tagging took 6 to 8 analyst hours per game, so growing from 40 to 150 teams would have meant about 15 more analysts.
- Players in the same jerseys swap identities in a crowded paint, and one swap ruins a player's stats for the rest of the game.
- The ball covers well under 1% of a 1080p frame, blurs on hard passes and hides behind hands.
- Footage came from one ordinary camera at 30 or 60 fps, and schools could not afford multi-camera installs.
💡 Solutions
- RT-DETR detects all 10 players, referees and the ball in every frame and drops anyone outside the court lines.
- A small-object detection head and a trajectory model keep the ball tracked when it hides behind hands.
- A ReID tracker uses appearance embeddings to re-link players after screens, pileups and substitutions.
- A color-based classifier learns both teams' jerseys in the first 30 seconds of footage.
- Court homography turns pixels into feet for speed, distance, spacing and shot locations.
- Shot charts, spacing maps, lineup splits and clips sit in one dashboard and a mobile app.
Business value
- ~94% detection precision and ~97% team assignment accuracy.
- ~70% fewer identity switches with ReID.
- About 30 minutes from final buzzer to a full game report.
- 150+ games a week, with analysts reviewing instead of tagging.
- 40 metrics per player per game, including speed, distance and shot charts.
User flow