This project provides a real-time running analysis tool using computer vision and pose estimation techniques. It captures video input from a camera, analyzes the runner's form, and provides instant feedback on various biomechanical metrics.
- Real-time pose estimation using multiple model options (MoveNet, BlazePose, Lite-HRNet)
- Calculation of key running metrics (e.g., head angle, trunk angle, knee angles, arm swing)
- Visual feedback with adjustable display modes (angles, metrics, recommendations)
- Audio feedback for immediate form corrections
- Metric logging for post-run analysis
- Video recording and playback functionality
- Python 3.7+
- OpenCV
- TensorFlow
- PyTorch
- MediaPipe
- PyQt5
- NumPy
- pyttsx3
-
Clone the repository:
git clone https://github.com/your-username/running-analysis.git cd running-analysis
-
Install the required dependencies:
pip install -r requirements.txt
-
Download the necessary model files and place them in the
models/
directory.
Run the main script with desired options:
python main.py --model_type blazepose --side left --runner_height 182
Options:
--model_type
: Choose from 'movenet', 'blazepose', or 'lite_hrnet' (default: blazepose)--side
: 'left' or 'right', depending on which side of the runner is facing the camera (default: left)--runner_height
: Height of the runner in cm (default: 182)
core/analyzer.py
: Main analysis loop and frame processingmodels/
: Contains different pose estimation model implementationsmetrics/
: Calculates various running metricsvisualization/
: Handles display of metrics and pose on video framesfeedback/
: Provides recommendations and audio feedbackutils/
: Utility functions for angle calculation, filtering, etc.
- Adjust thresholds in
feedback/assessment_calculator.py
to customize metric assessments - Modify
feedback/recommendations.py
to change the recommendation logic - Update
core/config.py
for global configuration settings
After each session:
- Options to review recorded video
- View summary of logged metrics
- Save or delete session data
Contributions are welcome! Please feel free to submit a Pull Request.
- TensorFlow for MoveNet implementation
- Google's MediaPipe for BlazePose
- Contributors to the Lite-HRNet project