Quick Start¶
CLI Usage¶
The fastest way to analyze a climbing video is using the command-line interface:
Basic Analysis¶
This outputs climbing metrics directly to the terminal.
Export Data¶
The JSON file contains all frame-by-frame metrics and summary statistics.
Create Annotated Video¶
# Create video with metrics dashboard on the side (default: no overlay)
python scripts/analyze_climb.py climbing_video.mp4 --video output.mp4
# Customize dashboard position (left or right)
python scripts/analyze_climb.py climbing_video.mp4 --video output.mp4 --position left
# Use overlay mode instead of side-by-side
python scripts/analyze_climb.py climbing_video.mp4 --video output.mp4 --overlay
# Add text overlay with current metric values
python scripts/analyze_climb.py climbing_video.mp4 --video output.mp4 --show-text
Combined Export¶
# Export both JSON and video in one pass
python scripts/analyze_climb.py climbing_video.mp4 --json data.json --video output.mp4
Python API¶
Basic Usage¶
from climb_sensei import PoseEngine, VideoReader, ClimbingAnalysis
# Initialize analyzer
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
results = engine.process(frame)
if results:
# Extract landmarks
landmarks = engine.extract_landmarks(results)
# Analyze frame - get all metrics
metrics = analyzer.analyze_frame(landmarks)
print(f"Velocity: {metrics['com_velocity']:.4f}")
print(f"Stability: {metrics['com_sway']:.4f}")
print(f"Progress: {metrics['vertical_progress']:.3f}")
# 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}")
Running the Demo¶
The demo will:
- Open your webcam
- Detect your pose in real-time
- Display pose landmarks and basic metrics
- Press 'q' to quit
Next Steps¶
- Read the Usage Guide for detailed examples
- Check the Metrics Reference to understand all available metrics
- Explore the API Reference for complete documentation