How ssunsonic/basketball works
VizBuckets processes basketball video or camera input to detect players, the ball, rim and shot events; it tracks player identities, attributes attempts and makes, draws trajectory and score overlays, and writes an annotated video. SORT supplies multi-object identity tracking. The README also describes single-player/1v1 tracking and shot-trajectory mapping. Source excerpts show the main processing and SORT calls, but omit some wiring; the court-line utility is not documented as an active workflow, so it is not connected here.
Main entry points: main.py Tracking application · sort.py SORT tracker · output.py Output naming · distances.py Distance helpers
Components 12
Video tracking
- Tracking application
src/main.py - YOLO detection
- Output naming
src/utils/output.py
Shot analysis
- Shot event logic
src/main.py - Player shot metrics
src/main.py - Distance helpers
src/utils/distances.py
Player tracking
- SORT tracker
sort/sort.py - Player positions
src/main.py
Visualization
- Shot trajectory
src/utils/trajectory.py - Frame overlays
src/main.py
Other components
- Video or camera
- Annotated video
Connections 12
- Video or camera → Tracking application: supplies frames
- Tracking application → YOLO detection: runs detection
- Tracking application → Shot event logic: handles detections
- Tracking application → SORT tracker: updates tracks
- SORT tracker → Player positions: returns identities
- Tracking application → Player positions: updates positions
- Shot event logic → Distance helpers: checks distances
- Shot event logic → Player shot metrics: updates counts
- Tracking application → Shot trajectory: draws trajectory
- Tracking application → Frame overlays: draws interface
- Tracking application → Output naming: chooses output path
- Tracking application → Annotated video: writes frames