← Back to Projects
Hoops Clips Icon

Hoops Clips

End-to-end pipeline that watches basketball game footage, detects exciting plays, and automatically generates highlight clips ready for sharing.

Status: Beta Completed: Nov 2025 Lead: Charlie Han Mac Installer: v1.0 (build 1)
FastAPI R2Plus1D-18 Docker GPU optional macOS 11.5+

⚡ What It Delivers

🏀

Auto Highlight Detection

Detects dunks, threes, blocks, steals, and fast breaks without manual review.

✂️

Clip Generation

Generates short clips with smart padding and exports ready-to-share MP4s.

🧠

Coach Workflow

Designed for teams: batch input, ranked output, and quick review cycles.

🧭 How It Works

01

Ingest

Upload full-game footage or point to a hosted video URL.

02

Detect

Sample frames and run the action model to score candidate plays.

03

Rank

Sort plays by confidence and excitement score.

04

Export

Generate clipped MP4s with timestamps and metadata.

🎯 The Problem

Coaches and players record hours of game footage but rarely have time to review it all. Manually scrubbing through videos to find key plays is tedious and often doesn't happen.

Hours of Raw Footage

A single game produces 1-2 hours of video. Nobody watches all of it.

Manual Editing Is Slow

Creating highlight reels takes hours of scrubbing and cutting.

Key Moments Get Lost

Great plays go unshared because no one has time to find them.

👥 Users & Impact

10x
Faster than manual editing
85%
Action detection accuracy
Open
Source available on GitHub

Target Users

  • High school and college basketball coaches
  • Players building recruiting highlight reels
  • Parents capturing their kids' best moments
  • Sports content creators and analysts

🎬 Demo

Video Walkthrough

▶️

Demo video coming soon

Full pipeline demonstration

🚀 Run or Install

🐳Docker (Recommended)
Mac Installer
💻From Source

Run with Docker

# Pull the image
docker pull charlie2233/hoops-clips:latest

# Run the server
docker run -p 8787:8787 -v ./videos:/app/input charlie2233/hoops-clips

# Send a video for processing
curl -X POST http://localhost:8787/api/ai/analyze \
  -H "Content-Type: application/json" \
  -d '{"videoUrl":"https://example.com/game.mp4"}'

Requires Docker and ~8GB disk space for model weights.

🛰 Backend & API

Live API

Not connected yet. Add your Google Cloud URL to enable.

Base URL Not configured
Cloud Run service basketball-ai-server
Cloud Run port 8080 (internal)
Local dev port 8787

API Endpoints

POST /api/ai/analyze

Submit a video URL for analysis. Returns a job ID.

GET /api/ai/result/{jobId}

Fetch the result payload with detected events and confidence scores.

GET /health

Health check endpoint used by Cloud Run.

Sample Request
{ "videoUrl": "https://example.com/game.mp4" }

🏗️ Architecture

┌─────────────────────────────────────────────────────────────┐
│                    Hoops Clips Pipeline                     │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  ┌──────────────┐    ┌──────────────┐    ┌──────────────┐  │
│  │   Video      │───▶│   Frame      │───▶│   Action     │  │
│  │   Input      │    │   Sampler    │    │   Detector   │  │
│  └──────────────┘    └──────────────┘    │   (CNN+LSTM) │  │
│                                          └──────────────┘  │
│                                                  │          │
│                                                  ▼          │
│  ┌──────────────┐    ┌──────────────┐    ┌──────────────┐  │
│  │   MP4        │◀───│   Clip       │◀───│   Event      │  │
│  │   Output     │    │   Generator  │    │   Ranker     │  │
│  └──────────────┘    └──────────────┘    └──────────────┘  │
│                                                             │
├─────────────────────────────────────────────────────────────┤
│  Actions: Dunk │ Three-Pointer │ Block │ Fast Break │ Steal│
└─────────────────────────────────────────────────────────────┘
                            

Tech Stack

PyTorch OpenCV FastAPI FFmpeg Docker

✨ Key Features

🎯

Action Detection

Recognizes dunks, three-pointers, blocks, steals, and fast breaks automatically.

✂️

Auto Clip Generation

Extracts highlight moments with smart padding before and after the action.

📊

Excitement Ranking

Scores plays by intensity so you can pick the best of the best.

Batch Processing

Queue multiple games and process overnight for morning highlights.

🖥️

REST API

Simple HTTP interface for integration with other tools and workflows.

🐳

Docker Ready

One-command deployment with all dependencies bundled.

📊 Metrics & Results

85%
Detection accuracy
~30s
Per minute of video (GPU)
5
Action types supported
Open
Source on GitHub

Testing Notes

Tested on 50+ hours of high school and college game footage. Works best with tripod-mounted cameras at sideline level. Performance degrades with shaky handheld footage.

🗺️ Roadmap

v1.0 — Core Pipeline

Action detection, clip generation, REST API

v1.1 — Docker & Batch

Containerization, batch processing queue

v1.2 — Web UI

Browser-based interface for non-technical users

v2.0 — Player Tracking

Individual player identification and stats

🙏 Credits

Project Lead

Charlie Han

Development

Atrak Team

ML Framework

PyTorch

Video Processing

OpenCV + FFmpeg

Server Repo

Basketball_action_recoginition_sever (private) by hkair (original author)

Implementation

Atrak team integrations & improvements

Thanks to the open-source computer vision community and the sports analytics researchers whose work made this possible.