A Python computer vision toolkit for analyzing workout videos. Uses MediaPipe and OpenCV to detect body poses, calculate joint angles, and generate exercise configuration data. Includes multiple analyzer variants for different use cases, Excel-to-JSON conversion tools, and a Flask upload API.
| Category | Technology |
|---|---|
| Language | Python 3 |
| Vision | MediaPipe Pose, OpenCV |
| Data | NumPy, Pandas |
| API | Flask, Werkzeug |
| Notebooks | Jupyter |
- Real-time pose detection -- MediaPipe tracks body landmarks from video, calculating angles for shoulders, elbows, armpits, waist, and knees (left and right).
- Multiple analyzer modes -- Choose from basic, interactive, averaging, or range-display analyzers depending on the analysis workflow.
- Categorized pose capture -- Tag captured poses with category keys (0-9) and get per-category summaries with average, min, and max angles.
- Excel-to-JSON conversion -- Transform exercise definition spreadsheets into structured JSON configurations for the Workute platform.
- Video upload API -- Flask endpoint for receiving workout videos (up to 500MB) with automatic timestamped file naming and logging.
| Script | Description |
|---|---|
workout_analyzer.py |
Basic analyzer -- pause video with spacebar to view joint angles |
workout_analyzer_interactive.py |
Categorize poses with 0-9 keys, get summary with averages |
workout_analyzer_avg.py |
Configurable angle range width, category-based summaries |
workout_analyzer_range.py |
Enhanced terminal display with min/max angle columns |
| Script | Description |
|---|---|
excel_json.py |
Read 3 Excel sheets and output exercise JSON to console |
excel_jsontxt.py |
Same conversion, saves to .txt file with dynamic naming |
| Script | Description |
|---|---|
upload_api.py |
Flask server (port 5003) accepting video uploads via POST |
- Python 3.8+
- pip
git clone https://github.com/MelodyccLo/WorkutePoseAnalyze.git
cd WorkutePoseAnalyze
pip install mediapipe opencv-python numpy pandas flaskRun a video analyzer:
python workout_analyzer_interactive.py- Press spacebar to pause and capture the current pose
- Press 0-9 to assign the capture to a category
- Press q to quit and view the summary
Convert Excel to JSON:
python excel_json.pyStart the upload API:
python upload_api.pyUpload a workout video file for processing.
| Field | Type | Description |
|---|---|---|
| file | file | Video file (mp4, mov, avi, mkv, webm, max 500MB) |
Health check endpoint. Returns a timestamp.
WorkutePoseAnalyze/
├── workout_analyzer.py # Basic pose analyzer
├── workout_analyzer_interactive.py # Interactive categorized analyzer
├── workout_analyzer_avg.py # Averaging analyzer
├── workout_analyzer_range.py # Range display analyzer
├── excel_json.py # Excel to JSON converter
├── excel_jsontxt.py # Excel to JSON text file converter
├── upload_api.py # Flask video upload API
├── video/ # Test videos
├── Excel to Json/ # Sample Excel templates
├── json txt/ # Sample JSON output
└── jupyternotebook/ # Exploratory notebooks