Skip to content

Streamlit app that uses opencv, mediapipe and a custom trained YOLO v8 model to classify and correct three types of exercises real time.

License

Notifications You must be signed in to change notification settings

AliH17/ExercisePoseCorrection

Repository files navigation

ExercisePoseCorrection 🔥 🏋🏻‍♂️

This project implements a real-time fitness tracking and posture correction system using computer vision and deep learning techniques. It focuses on detecting and classifying three key exercises—push-ups, squats, and bicep curls—while providing real-time feedback on exercise form.

Image

🛠️ Methodology

1. Data Collection & Model Training

Videos of excercises were recorded at 60fps, the frames were then extracted using a simple python script, finally annotation and data augmentation was done with the help of roboflow

image

Dataset was split into 70% training, 20% validation and 10% Test sets and was then trained using YOLOv8 for robust and fast excercise detection

2. Model Training Results

We were able to achieve a Precision of 99%, Recall 89% and mAP50-95 score of 92.7%

3. Pose Estimation & Form Analysis

MediaPipe Pose was used to identify the body landmarks, upoun which depending on the type of excercise classified a logic was using to determine if the posture is correct or not •Push-Ups: Detect up/down phases and evaluate back alignment. •Squats: Analyze knee alignment, shoulder-to-knee posture, and back angle. •Bicep Curls: Assess elbow movement and shoulder stability.

4. Deployment

Streamlit was used to deploy the model with three modes of input (Webcam, DroidCam and Video Uploads) to allow real time feedback

5. Demo

Demo.mp4

🖥️ Installation and Usage Prerequisites

Python 3.7+
GPU (optional but recommended for real-time performance)

Installation

Clone the repository:
git clone https://github.com/your-username/workout-posture-correction.git

Install dependencies:

pip install -r requirements.txt

Run the Streamlit app:

streamlit run excercise_pose_correction.py

Input Options

Webcam: Use a PC or external webcam.
DroidCam USB: Install DroidCam app on your smartphone and connect via USB.
Video Uploads: Upload recorded exercise videos for analysis.

Contributors

Ali Haider Muqaram Majid Syed Afraz

About

Streamlit app that uses opencv, mediapipe and a custom trained YOLO v8 model to classify and correct three types of exercises real time.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages