Spaces:
Runtime error
title: Athletic Ability Analysis
emoji: πββοΈ
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 4.32.2
app_file: app.py
pinned: false
license: mit
πββοΈ Athletic Ability Analysis
A powerful web application that analyzes athletic jump performance from videos using computer vision and pose estimation. Upload a video file or provide a YouTube URL to get detailed metrics about your jump height, flight time, and overall athletic performance.
β¨ Features
- π₯ YouTube Integration: Analyze videos directly from YouTube URLs
- π File Upload: Support for MP4, AVI, MOV, and other video formats
- π Detailed Analytics: Get jump height, flight time, normalized rise, and performance insights
- π― Real-time Processing: Fast analysis using Google's MediaPipe pose estimation
- π± Modern Interface: Beautiful, responsive Gradio interface
- π¬ Scientific Accuracy: Precise biomechanical analysis
π Live Demo
Try the live demo on Hugging Face Spaces: Athletic Ability Analysis
π How It Works
- Pose Detection: Uses Google's MediaPipe to detect human pose landmarks in each video frame
- Hip Tracking: Tracks the midpoint between left and right hip joints throughout the video
- Jump Analysis: Calculates jump metrics based on hip trajectory:
- Jump Height: Vertical distance from crouch to apex (in cm)
- Flight Time: Duration of airborne phase (in seconds)
- Normalized Rise: Jump height relative to body position (0-1 scale)
- Performance Insights: Contextual feedback based on performance level
π οΈ Technology Stack
- Backend: Python with OpenCV, NumPy, and MediaPipe
- Frontend: Gradio for beautiful, interactive web interface
- Video Processing: yt-dlp for YouTube downloads, OpenCV for video analysis
- Deployment: Hugging Face Spaces
π Deploy to Hugging Face Spaces
Quick Deployment
- Fork this repository on GitHub
- Create a new Space on Hugging Face Spaces
- Connect your GitHub repo to the Space
- Set the Space type to "Gradio"
- Wait for automatic deployment
Manual Deployment
Clone the repository:
git clone https://github.com/YOUR_USERNAME/athletic-ability-analysis cd athletic-ability-analysisCreate a new Space on Hugging Face Spaces
Upload files to your Space:
app.py(main application)requirements.txt(dependencies)README.md(this file)
Space will automatically deploy using Gradio
π Project Structure
athletic-ability-analysis/
βββ app.py # Main Gradio application
βββ requirements.txt # Python dependencies
βββ README.md # This file (with HF Spaces header)
βββ .gitignore # Git ignore file
π― Usage
Web Interface
- Visit your Hugging Face Space URL
- Enter your height in centimeters for accurate calculations
- Choose input method:
- YouTube: Paste a YouTube URL containing a jump video
- File Upload: Upload a video file from your device
- Click "Analyze" and wait for processing
- View detailed results including metrics and performance insights
Supported Video Formats
- YouTube: Any public YouTube video URL
- Upload: MP4, AVI, MOV, MKV, WebM
π Video Requirements
For optimal results, ensure your videos meet these criteria:
- π― Full Body Visible: Person should be completely visible throughout the jump
- π‘ Good Lighting: Clear visibility with minimal shadows
- π¬ Clean Background: Minimal clutter for better pose detection
- β±οΈ Optimal Duration: 3-30 seconds works best
- π Vertical Jumps: Straight vertical jumps produce most accurate results
- π Public Access: For YouTube videos, ensure they're not private
π Performance Metrics
The app analyzes and provides:
- Jump Height (cm): Absolute vertical distance based on your body height
- Flight Time (s): Duration of airborne phase
- Normalized Rise: Jump efficiency relative to body size
- Performance Level: Contextual feedback (Excellent/Good/Moderate/Starting)
- Training Insights: Personalized recommendations
π¬ Technical Details
- Pose Estimation: MediaPipe Pose with 33 body landmarks
- Processing: Real-time frame-by-frame analysis
- Smoothing: Moving average filtering for noise reduction
- Calculations: Biomechanically accurate jump metrics
- Performance: Optimized for cloud deployment
β οΈ Limitations
- Processing Time: Large videos may take 2-5 minutes to process
- File Size: Recommended maximum 100MB for uploads
- Pose Visibility: Person must be clearly visible throughout the jump
- Jump Type: Optimized for vertical jumps (not broad jumps)
π§ Local Development
To run locally:
Install dependencies:
pip install -r requirements.txtRun the application:
python app.pyOpen in browser: Gradio will provide a local URL
π€ Contributing
Contributions are welcome! Please feel free to:
- Submit bug reports and feature requests
- Improve documentation
- Add new analysis features
- Optimize performance
π License
This project is open source and available under the MIT License.
π Support & Troubleshooting
If you encounter issues:
- Video Quality: Ensure good lighting and clear visibility
- YouTube URLs: Make sure the video is public and accessible
- File Formats: Use supported video formats (MP4, AVI, MOV, etc.)
- Processing Time: Be patient with large or high-resolution videos
- Pose Detection: Person should be fully visible during the jump
π Acknowledgments
- Google MediaPipe for state-of-the-art pose estimation
- OpenCV for computer vision processing
- yt-dlp for YouTube video downloading
- Gradio for the beautiful web interface
- Hugging Face for hosting and deployment platform
π Example Results
π Jump Analysis Results
π Performance Metrics
- Jump Height: 52.34 cm
- Flight Time: 0.623 seconds
- Normalized Rise: 0.387 (38.7%)
π₯ Excellent jump height! This is above average performance.
β±οΈ Great flight time! Shows good explosive power.