How abdullahtarek/basketball_analysis works
This is a basketball video-analysis application: a user supplies game footage, and the pipeline produces an annotated video with tracked players and ball, court keypoints, team assignments, possession and event statistics, and movement metrics. The README documents the overall orchestration; the sampled source confirms several detector, tracker, and analytics responsibilities. Some main.py sections and several drawer implementations were not sampled, so those connections rely on README documentation rather than direct call excerpts.
Main entry points: main.py Pipeline orchestration · stubs_utils.py Stub cache · player_tracker.py Player tracking · ball_tracker.py Ball tracking
Components 22
Video pipeline
- Pipeline orchestration
main.py - Video I/O
utils/video_utils.py - Stub cache
utils/stubs_utils.py
Detection and tracking
- Player tracking
trackers/player_tracker.py - Ball tracking
trackers/ball_tracker.py - Court keypoints
court_keypoint_detector/court_keypoint_detector.py
Game analysis
- Team assignment
team_assigner/team_assigner.py - Ball possession
ball_aquisition/ball_aquisition_detector.py - Passes and interceptions
pass_and_interception_detector/pass_and_interception_detector.py - Tactical court mapping
tactical_view_converter/tactical_view_converter.py - Homography
tactical_view_converter/homography.py - Speed and distance
speed_and_distance_calculator/speed_and_distance_calculator.py - Bounding-box geometry
utils/bbox_utils.py
Visualization
- Player overlays
drawers/player_tracks_drawer.py - Ball overlays
drawers/ball_tracks_drawer.py - Court overlays
drawers/court_key_points_drawer.py - Team control overlay
drawers/team_ball_control_drawer.py - Event statistics overlay
drawers/pass_and_interceptions_drawer.py - Movement metrics overlay
drawers/speed_and_distance_drawer.py - Tactical view overlay
drawers/tactical_view_drawer.py - Frame numbering
drawers/frame_number_drawer.py
Other components
- Video analyst
Connections 25
- Video analyst → Pipeline orchestration: supplies video
README.md - Pipeline orchestration → Video I/O: reads and saves
main.py - Pipeline orchestration → Player tracking: tracks players
main.py - Pipeline orchestration → Ball tracking: tracks ball
main.py - Pipeline orchestration → Court keypoints: detects keypoints
main.py - Pipeline orchestration → Team assignment: assigns teams
main.py - Pipeline orchestration → Ball possession: finds possession
README.md - Pipeline orchestration → Passes and interceptions: detects events
README.md - Pipeline orchestration → Tactical court mapping: maps court positions
main.py - Pipeline orchestration → Speed and distance: calculates movement
main.py - Pipeline orchestration → Player overlays: draws annotations
README.md - Pipeline orchestration → Ball overlays: draws annotations
README.md - Pipeline orchestration → Court overlays: draws annotations
README.md - Pipeline orchestration → Team control overlay: draws annotations
README.md - Pipeline orchestration → Event statistics overlay: draws event stats
README.md - Pipeline orchestration → Movement metrics overlay: draws movement stats
README.md - Pipeline orchestration → Tactical view overlay: draws tactical view
README.md - Pipeline orchestration → Frame numbering: draws frame numbers
README.md - Player tracking → Stub cache: reads and writes
trackers/player_tracker.py - Ball tracking → Stub cache: reads and writes
trackers/ball_tracker.py - Court keypoints → Stub cache: reads and writes
court_keypoint_detector/court_keypoint_detector.py - Team assignment → Stub cache: reads and writes
team_assigner/team_assigner.py - Ball possession → Bounding-box geometry: uses geometry
ball_aquisition/ball_aquisition_detector.py - Tactical court mapping → Homography: uses transform
tactical_view_converter/tactical_view_converter.py - Speed and distance → Bounding-box geometry: uses distance
speed_and_distance_calculator/speed_and_distance_calculator.py