PBVision / SwingVision style AI analysis for any racquet sport video.
Automatically detects rallies, tracks players, classifies shots, and generates complete player performance profiles — from any video angle (portrait or landscape).
Supported Sports
Sport
Ball Tracking
Shot Types
Court Detection
🏸 Badminton
✅
15 types (smash, drop, clear, ...)
✅
🎾 Tennis
✅
12 types (forehand, backhand, serve, ...)
✅
🥒 Pickleball
✅
11 types (dink, third-shot-drop, erne, ...)
✅
🏓 Padel
✅
11 types (bandeja, vibora, bajada, ...)
✅
What It Does
INPUT: Any racquet sport video (phone recording, broadcast, GoPro)
↓
┌──────────────────────────────────────────┐
│ Court Detection (lines, net, homography)│
│ Player Detection + Tracking (YOLO11) │
│ Ball/Shuttle Tracking (CV + Kalman) │
│ Hit Detection (ball reversal + wrist) │
│ Rally Segmentation (temporal grouping) │
│ Shot Classification (VideoMAE) │
│ Player Analytics (movement, shots, etc) │
└──────────────────────────────────────────┘
↓
OUTPUT:
📼 Annotated video with overlays
📊 JSON report with full match analysis
🗺️ Player movement heatmaps
👤 Player profiles (playstyle, strengths/weaknesses)
Quick Start
1. Install
pip install -r requirements.txt
2. Run on your video
bash
1# Auto-detect sport, GPU mode2python run_analysis.py --video match.mp4
34# Specify sport + output dir5python run_analysis.py --video match.mp4 --sport badminton --output ./my_analysis
67# Portrait video from phone (pickleball at the park)8python run_analysis.py --video phone_recording.mp4 --sport pickleball
910# CPU mode (slower but works everywhere)11python run_analysis.py --video match.mp4 --device cpu
1213# Fast mode: skip frames + no shot classification14python run_analysis.py --video match.mp4 --frame-skip 2 --no-shot-classification
Modular pipeline over end-to-end: Each component can be upgraded independently. Start with classical CV ball tracking, upgrade to TOTNet later. Start with YOLO-pose, upgrade to ViTPose+ later.
Classical CV ball tracker as default: Works on all sports without training. The TrackNet-style deep model is a placeholder — train it on your data for 10x better ball detection.
Dual-signal hit detection: Fuses ball direction reversal (from ball tracker) with wrist velocity spikes (from pose keypoints). Either signal alone has false positives; combined they're robust.
Hit-frame-centered clips for shot classification: The BST paper proved this is significantly better than fixed-width temporal windows. We extract 3 frames before + 12 frames after each hit for classification.
Playstyle classification from multi-signal scoring: Movement speed + shot distribution + rally patterns → weighted score across aggressive/defensive/all-round/counter-puncher archetypes.