A real-time exercise pose detection system based on MediaPipe and LSTM, capable of recognizing different exercise movements including push-ups, squats, and sit-ups.
Click on the image above to watch the demo video

git clone https://github.com/timchen1015/FitPose-Detector.git
cd FitPose-Detector
# Create a virtual environment
python -m venv venv
# Activate the virtual environment (Windows)
venv\Scripts\activate
pip install -r requirements.txt
Required packages:
To start the real-time exercise recognition:
# Make sure your virtual environment is activated (Windows)
# venv\Scripts\activate
python main.py
This will:
project_root/
│
├── main.py # Main application for real-time detection
├── requirements.txt # Required Python packages
│
├── trained_pose_model/ # Pre-trained model files
│ ├── train_model.py # Script for training the model
│ ├── best_model.keras # Trained LSTM model
│ ├── label_encoder.npy # Class labels for exercises
│ └── training_history.png # Model training performance
│
└── exercise_dataset/ # Dataset folder
├── extract_video.py # Script to extract frames from videos
├── image_dataset/ # Processed image frames for training (generated by extract_video.py)
└── video_dataset/ # Raw video datasets (must download from Google Drive and place here)
├── push_up_video/ # Push-up exercise videos
├── sit_up_video/ # Sit-up exercise videos
└── squat_video/ # Squat exercise videos
Due to GitHub file size limitations, the video dataset files are not included in this repository. Instead, you can download them from this Google Drive link:
exercise_dataset/video_dataset/# Make sure your virtual environment is activated (Windows)
# venv\Scripts\activate
# Run the frame extraction script
python exercise_dataset/extract_video.py
This script will:
You can also use your own exercise videos:
exercise_dataset/video_dataset/After processing the dataset, train the model with:
# Make sure your virtual environment is activated (Windows)
# venv\Scripts\activate
python trained_pose_model/train_model.py
Check out our demonstration video to see FitPose-Detector in action:
The demo shows:
For questions or collaboration opportunities, please reach out to timchen1015.
Check out the original GitHub repository:
View this project on GitHub