Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

devhttps/PersonalAI

Repository files navigation

๐Ÿ‹๏ธโ€โ™‚๏ธ AI Personal Trainer

An intelligent personal training system based on AI that uses computer vision to analyze posture, count exercises, and provide real-time feedback.

โœจ Features

  • Posture Detection: Analysis of 33 body points using MediaPipe
  • Automatic Counting: Counts push-ups and other exercises automatically
  • Angle Analysis: Calculates angles between joints to verify correct form
  • Web Interface: Interactive dashboard with Streamlit for real-time visualization
  • Video Processing: Support for video files (.MOV, .MP4)
  • Real-time Metrics: Movement graphs and exercise statistics

๐Ÿš€ Technologies Used

  • Python 3.11+
  • MediaPipe - AI framework for computer vision
  • OpenCV - Video and image processing
  • Streamlit - Interactive web interface
  • Pandas & NumPy - Data manipulation and analysis
  • Matplotlib - Data visualization

๐Ÿ“‹ Prerequisites

  • Python 3.11 or higher
  • Webcam or video file for analysis
  • Internet connection for MediaPipe model download

๐Ÿ› ๏ธ Installation

  1. Clone the repository
git clone https://github.com/seu-usuario/ai-personal-trainer.git
cd ai-personal-trainer
  1. Install dependencies
pip install -r requirements.txt
  1. MediaPipe model download The pose_landmarker_full.task model is already included in the repository.

๐ŸŽฏ How to Use

1. Basic Video Analysis

python pose_estimator.py

2. Complete AI System

python personal_ai.py

3. Web Interface (Recommended)

streamlit run personalai_dash.py

๐Ÿ“ Project Structure

AI Personal Trainer/
โ”œโ”€โ”€ personal_ai.py # Core AI system
โ”œโ”€โ”€ personalai_dash.py # Web interface with Streamlit
โ”œโ”€โ”€ pose_estimator.py # Basic detection module
โ”œโ”€โ”€ pose_landmarker_full.task # MediaPipe model
โ”œโ”€โ”€ requirements.txt # Python dependencies
โ”œโ”€โ”€ IMG_2149.mov # Example video
โ””โ”€โ”€ README.md # This file

๐Ÿ”ง Configuration

Video Files

  • Supported formats: .MOV, .MP4, .AVI
  • Recommended resolution: 720p or higher
  • Recommended FPS: 24-30 fps

Monitored Body Points

  • Shoulders: Points 11 (right) and 12 (left)
  • Hips: Points 23 (right) and 24 (left)
  • Elbows: Points 13 (right) and 14 (left)
  • Total: 33 body points

๐Ÿ“Š Analysis Features

Exercise Detection

  • Push-ups: Automatic counting based on elbow angles
  • States: "relaxed", "ready", "up"/"down" direction
  • Metrics: Real-time angles, repetition counter

Visualization

  • Body landmarks drawn on video
  • Real-time angle display
  • Movement graphs of body points
  • Dashboard with statistics

๐ŸŽฎ Interface Controls

  • Display Charts: Enable/disable movement graphs
  • Reset: Restart counters and metrics
  • Status: Show current exercise state
  • Count: Display repetition count

๐Ÿ” Usage Examples

Push-up Analysis

from personal_ai import PersonalAI
# Initialize system
trainer = PersonalAI("your_video.mov")
# Process video
trainer.process_video(display=True)
# Run in background
trainer.run()

Web Interface

# Start dashboard
streamlit run personalai_dash.py
# Access in browser
# http://localhost:8501

๐Ÿ“ˆ Advanced Features

  • Asynchronous Processing: Queue system for better performance
  • Multiple Exercises: Support for different types of movements
  • Quality Analysis: Verification of correct form and posture
  • Data Export: Metrics saved for later analysis

๐Ÿ› Troubleshooting

Error: "No module named 'mediapipe'"

pip install mediapipe --upgrade

Error: "Error opening video stream or file"

  • Check if video file exists
  • Confirm correct path in code
  • Test with different video formats

Slow Performance

  • Reduce video resolution
  • Use GPU if available
  • Adjust FPS for processing

๐Ÿค Contributing

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“ License

This project is under the MIT license. See the LICENSE file for more details.

๐Ÿ™ Acknowledgments

  • MediaPipe for posture detection technology
  • Google for the AI framework
  • Streamlit for the web interface
  • Python Community for support

๐Ÿ“ž Contact

๐Ÿ”ฎ Roadmap

  • Support for more exercises
  • Advanced biomechanics analysis
  • Wearable integration
  • Mobile app
  • REST API
  • Custom Machine Learning

โญ If this project helped you, consider giving it a star on GitHub!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle ใซใ‚ˆใฃใฆๅค‰ๆ›ใ•ใ‚ŒใŸใƒšใƒผใ‚ธ (->ใ‚ชใƒชใ‚ธใƒŠใƒซ) /