climb-sensei¶
A Python pose estimation tool for analyzing climbing footage. Extract vertical movement metrics, calculate biomechanics, visualize technique with animated dashboards, and analyze climbing performance using computer vision.
Features¶
- ๐ฏ Pose Detection: Real-time human pose estimation using MediaPipe with temporal smoothing
- ๐ Performance Analysis: Comprehensive climbing metrics including speed, stability, smoothness, and body positioning
- ๐ฏ Efficiency Metrics: Movement economy, lock-off detection, rest position identification, and fatigue scoring
- ๐ Biomechanics: Calculate joint angles (8 joints), reach distances, and center of mass
- ๐น Video Processing: Easy video I/O with pose overlay and animated metrics dashboards
- ๐จ Visualization: Draw pose landmarks, annotate metrics, and create real-time performance graphs
- ๐ Temporal Analysis: Track metrics over time with jerk calculation, sway detection, and progression tracking
- โ Video Quality Validation: Pre-processing quality checks for resolution, FPS, duration, lighting, and stability
- ๐งช Well-Tested: Comprehensive test suite with high code coverage
Quick Example¶
from climb_sensei import PoseEngine, VideoReader, ClimbingAnalysis
# Analyze climbing performance
analyzer = ClimbingAnalysis(window_size=30, fps=30)
with PoseEngine() as engine:
with VideoReader('climbing_video.mp4') as video:
while True:
success, frame = video.read()
if not success:
break
# Detect pose and analyze
results = engine.process(frame)
if results:
landmarks = engine.extract_landmarks(results)
metrics = analyzer.analyze_frame(landmarks)
print(f"Velocity: {metrics['com_velocity']:.4f}")
print(f"Stability: {metrics['com_sway']:.4f}")
# Get summary statistics
summary = analyzer.get_summary()
print(f"Average speed: {summary['avg_velocity']:.4f}")
print(f"Total vertical progress: {summary['total_vertical_progress']:.3f}")
Project Structure¶
climb-sensei/
โโโ src/climb_sensei/
โ โโโ __init__.py # Package exports
โ โโโ __main__.py # Demo application
โ โโโ config.py # Configuration and constants
โ โโโ video_io.py # Video input/output handling
โ โโโ pose_engine.py # MediaPipe pose estimation
โ โโโ biomechanics.py # Pure mathematical calculations
โ โโโ metrics.py # ClimbingAnalysis with temporal tracking
โ โโโ metrics_viz.py # Metrics dashboard visualization
โ โโโ viz.py # Pose visualization utilities
โโโ scripts/
โ โโโ analyze_climb.py # Unified CLI (analysis + video generation)
โโโ tests/
โ โโโ test_*.py # Comprehensive unit tests
โ โโโ __init__.py
โโโ docs/ # Documentation
Requirements¶
- Python 3.12+
- mediapipe >= 0.10.30
- opencv-python >= 4.8.0
- numpy >= 1.24.0
- tqdm >= 4.66.0
License¶
See LICENSE file for details.
Contributing¶
Contributions are welcome! Please ensure:
- All functions have type hints
- Comprehensive docstrings
- Unit tests for new functionality
- Code follows existing style conventions