Skip to content

An AI-powered personal trainer that tracks and counts repetitions for exercises in real-time using MediaPipe for pose detection and a custom LSTM model for exercise classification.

Notifications You must be signed in to change notification settings

DevPatel1106/ExerciseTracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AI Exercise Trainer 🏋️‍♂️

Python License

An AI-powered personal trainer that tracks and counts repetitions for exercises in real-time using MediaPipe for pose detection and a custom LSTM model for exercise classification.


Features ✨

  • Real-time Pose Detection: Tracks 33 body landmarks.
  • Exercise Classification: Recognizes bicep_curl, push_up, squat, shoulder_press.
  • Repetition Counter: Counts reps automatically using joint angles.
  • Performance Metrics: Displays FPS for monitoring.

Quick Start 🚀

Prerequisites

  • Python 3.x
  • Webcam

Installation & Running the Application

  1. Clone the repository:
git clone https://github.com/DevPatel1106/Repo_github.git
cd Repo_github
  1. Install dependencies and Run:
pip install -r requirements.txt
python main.py

How It Works ⚙️

  • Capture Video: Webcam feed processed in a loop.
  • Pose Detection: Extracts 33 (x, y) landmark coordinates.
  • Sliding Window: Last 30 frames fed into the LSTM model.
  • Exercise Prediction: Model predicts the exercise class.
  • Repetition Counting: Detects “up” & “down” stages using joint angles.

Visual Example 🖼️

Real-Time Pose Detection image

  • Tracks 33 key body landmarks using MediaPipe.
  • Displays predicted exercise class, rep count, and FPS.

Tip: For best accuracy, ensure proper lighting and full-body visibility in the webcam frame.


Project Structure 📁

|- main.py – Runs video capture & integrates modules.

|- ExerciseAiTrainer.py – Core logic for classification & rep counting.

|- PoseModule2.py – Pose detection & angle calculations.

|- AiTrainer_utils.py – Utilities (image resizing, FPS display).

|- ML.ipynb – Notebook for model training.

|- requirements.txt – Python dependencies.

|_ lstm_model.keras, scaler.joblib, label_encoder.joblib – Pre-trained model & encoders.


About

An AI-powered personal trainer that tracks and counts repetitions for exercises in real-time using MediaPipe for pose detection and a custom LSTM model for exercise classification.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published