Let’s talk

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
Game summary dashboard on a laptop beside a phone with one player's speed curve and shot chart

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

Dashboard with player stats and a possession replayed as dots on a top-down court
Player page with a speed curve across four quarters and a shot chart

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

1. A coach uploads a game recording from the app, or a gym camera streams it.
2. RT-DETR finds players, referees and the ball in every frame.
3. The ReID tracker keeps each player on one ID through screens and substitutions.
4. The classifier splits players into two teams and referees by jersey color.
5. Homography maps positions onto the court to calculate speed, distance, spacing and shot location.
6. Stats, shot charts and tagged clips land in the dashboard and the app for the next film session.

This website uses cookies

We use cookies to personalize content and advertising, provide social networking features, and analyze our traffic. We also share information about your use of our website with our social media, advertising and analytics partners, who may combine it with other information you have provided to them or collected from your use of their services. You agree to our cookies if you continue to use our website.

Okay, I understand