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.
- 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.
- Python 3.x
- Webcam
- Clone the repository:
git clone https://github.com/DevPatel1106/Repo_github.git
cd Repo_github- Install dependencies and Run:
pip install -r requirements.txt
python main.py- 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.
- Tracks 33 key body landmarks using MediaPipe.
- Displays predicted exercise class, rep count, and FPS.
|- 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.
