Spaces:
Sleeping
title: Gladiator Pose Analyzer
emoji: πͺποΈββοΈ
colorFrom: blue
colorTo: green
sdk: docker
pinned: false
app_port: 7860
Gladiator Pose Analyzer πͺποΈββοΈ
Live Demo: [Link to your Gladiator Pose Analyzer Hugging Face Space] (<- REPLACE THIS with your actual Space URL after deployment)
Overview
The Gladiator Pose Analyzer is a web application designed for bodybuilding pose analysis and feedback. Users can upload videos of their poses, and the application utilizes computer vision models to provide insights into angles, form corrections, and pose classification.
This Space uses a Flask backend with various machine learning models for pose estimation and classification.
Features
- Video Upload: Upload your bodybuilding pose videos (MP4, AVI, MOV, MKV).
- Multiple Pose Estimation Models:
- Gladiator SupaDot (MediaPipe): General pose estimation using MediaPipe Pose.
- Gladiator BB - Lightning (MoveNet): Fast and efficient pose estimation with MoveNet Lightning.
- Gladiator BB - Thunder (MoveNet): Higher accuracy pose estimation with MoveNet Thunder.
- (Experimental) YOLOv7-w6 Pose: Object detection based pose estimation (can be selected if enabled in UI).
- Automated Pose Classification: A custom-trained CNN classifies common bodybuilding poses (e.g., Side Chest, Front Double Biceps).
- Real-time Feedback Panel: Displays:
- Selected model.
- Current classified pose (via CNN, updated periodically).
- Calculated body angles (e.g., shoulder, elbow, knee).
- Specific form corrections based on ideal angle ranges for classified poses.
- General notes for poses where specific angle checks aren't defined.
- Processed Video Output: View the input video overlaid with detected keypoints and the feedback panel.
How to Use
- Navigate to the Live Demo link provided above.
- Choose a Pose Estimation Model from the dropdown menu:
Gladiator SupaDot
(MediaPipe based)Gladiator BB - Lightning
(MoveNet Lightning)Gladiator BB - Thunder
(MoveNet Thunder)
- Select a Video File: Click the "Choose File" button and select a video of your pose.
- Upload: Click the "Upload Video" button.
- Processing: Wait for the video to be processed. The server will analyze the video frame by frame.
- View Results: The processed video with keypoint overlays and the dynamic feedback panel will be displayed.
Models Used
- Pose Estimation:
- MediaPipe Pose: For the "Gladiator SupaDot" option.
- Google MoveNet (Lightning & Thunder): TensorFlow Hub models for "Gladiator BB" options.
- YOLOv7-w6 Pose:
yolov7-w6-pose.pt
(if enabled/selected).
- Pose Classification:
- A custom Convolutional Neural Network (CNN) trained on bodybuilding poses, loaded from
external/BodybuildingPoseClassifier/bodybuilding_pose_classifier.h5
. - Classes: Side Chest, Front Double Biceps, Back Double Biceps, Front Lat Spread, Back Lat Spread.
- A custom Convolutional Neural Network (CNN) trained on bodybuilding poses, loaded from
Technical Stack
- Backend: Flask (Python)
- Frontend: HTML, CSS, JavaScript (served by Flask)
- CV & ML Libraries: OpenCV, TensorFlow/Keras, PyTorch, MediaPipe
- Deployment: Docker on Hugging Face Spaces
Known Issues & Limitations
- Accuracy of pose estimation and classification can vary depending on video quality, lighting, angle, and occlusion.
- The feedback provided is based on predefined angle ranges and may not cover all nuances of perfect form.
- Processing time can be significant for longer videos or when using more computationally intensive models.
Setup
- Install dependencies:
pip install -r requirements.txt
- Ensure the model files are in place:
- CNN model:
external/BodybuildingPoseClassifier/bodybuilding_pose_classifier.h5
- Run the application:
python app.py
The application will be available at http://localhost:7860
Usage
- Open the web interface
- Select a video file (supported formats: mp4, avi, mov, mkv)
- Choose the model (Gladiator SupaDot or MoveNet)
- Upload and wait for processing
- View the results with pose detection, angles, and corrections
Models
- Gladiator SupaDot: Custom pose analyzer with detailed angle measurements and form corrections
- MoveNet: Google's pose detection model for basic pose tracking
Dependencies
- Flask
- OpenCV
- TensorFlow
- MediaPipe
- NumPy
- Other dependencies listed in requirements.txt
Notes
- Maximum video file size: 100MB
- Processing time depends on video length and available hardware
- GPU acceleration is automatically enabled if available
License
This project is licensed under the MIT License - see the LICENSE file for details.
Remember to replace placeholder links and add any other specific information relevant to your project!