arrow_back Back to Works
AI / Video Analysis

Automated Basketball Game Stats Generation

Detects players, the ball, and the rim from game footage to automatically generate a scoring log with attributed scorers. Cross-references broadcast scoreboard OCR to confirm each score.

Duration

PoC development

Team

1 person

Engineered With PythonYOLOv8ByteTrackSigLIPOpenCV

01 // OVERVIEW

Project Overview

A system that takes basketball game footage as input and automatically performs player tracking, team classification, shot detection, and scorer identification to generate stats with scoring events. Its distinguishing feature is a two-stage approach that confirms scores the footage alone cannot fully resolve by integrating them with OCR readings from the broadcast scoreboard.

02 // KEY FEATURES

Key Features

sports_basketball

Player, Ball, and Rim Detection and Tracking

Assigns and tracks player IDs using YOLOv8 and ByteTrack. A custom-trained detector captures the ball and rim, and shots are judged from the ball's trajectory relative to the rim.

groups

Appearance-Based Team Classification

Clusters uniform appearance using SigLIP embeddings, UMAP, and KMeans to automatically separate the two teams, including automatic handling of achromatic (black/white/gray) uniforms.

fact_check

Confirmation via Scoreboard OCR Integration

Cross-references video events (when and who) with the broadcast scoreboard (whether it went in and for how many points), rejecting false detections and filling in scores the video missed.

03 // TECHNICAL DEEP-DIVE

Technical Highlights

Solution

Score Detection From Video Alone Is Unreliable

A ball descending through the net's exit is indistinguishable from a missed shot falling past the rim. Combining scoreboard OCR as a confirming layer eliminated both missed and over-counted scores in the validated clips.

Solution

Eligibility Rules to Prevent Misattributed Scorers

Combines ball-possession history with pose-based shooting-motion classification, introducing eligibility rules so that bench celebrations or a cameraman's stance aren't mistaken for a shot. Designed to never surface the wrong player's name.

04 // IMPACT & RESULTS

Results

Auto-Generated

Scoring log with attributed scorer

OCR-Integrated

Fills in scores video alone misses

PoC Validated

Confirmed across multiple game videos

Ready to Build?

Want to build something similar? Tell us about your project.

Free Consultation