Make use of the power of Mediapipe’s pose detection, this project is built in order to analyze, detect and classifying the forms of fitness exercises.
This project goal is to develop 4 machine learning models for 4 of the most home exercises (Bicep Curl, Plank, Squat and Lunge) which each model can detect any form of incorrect movement while a person is performing a correspond exercise. In addition, a web application that utilize the trained models, will be built in other to analyze and provide feedbacks on workout videos.
Here are some detections of the exercises:
- Bicep Curl
- Basic Plank
- Basic Squat
- Lunge
- Models' evaluation results and website screenshots here
-
For data processing and model training
-
For building website
Due to the lack of videos or dataset online that recorded human doing exercises both in a proper or improper way, the majority of self-collected videos were either recorded by myself, my friends or my family. The majority of the collected videos were removed due to privacy purpose.
With an exercise such as Plank, as there is not much movement during the exercise, I’m able to find a dataset from an open database from Kaggle. The found dataset is about many yoga poses but the very well-known ones are the downward dog pose, goddess pose, tree pose, plank pose and the warrior pose. The dataset contains 5 folders for 5 poses, each folder contains images of people correctly doing the correspond pose.
For the purpose of this thesis, only the folder contains the images of people properly doing plank is chosen. There are 266 image files in that folder, I handpicked all the images that represent a basic plank and discard the reset. In conclusion, there are 30 images which are arranged to the proper form class for basic plank.
This is an example of how you may give instructions on setting up the project locally.
Python 3.8.13
Node 17.8.0
NPM 8.5.5
OS: Linux or MacOS
NOTES
⚠️ Commands/Scripts for this project are wrote for Linux-based OS. They may not work on Windows machines.
If you only want to try the website, look here.
-
Clone the repo and change directory to that folder
git clone https://github.com/NgoQuocBao1010/Exercise-Correction.git
-
Install all project dependencies
pip install -r requirements.txt
-
Folder core is the code for data processing and model training.
-
Folder web is the code for website.
As the introduction indicated, there are 2 purposes for this project.
-
Model training (describe in depth here). Below are the evaluation results for each models.
-
Bicep Curl - lean back error: Confusion Matrix - ROC curve
-
Plank - all errors: Confusion Matrix - ROC curve
-
Basic Squat - stage: Confusion Matrix - ROC curve
-
Lunge - knee over toe error: Confusion Matrix - ROC curve
-
-
Website for exercise detection. This web is for demonstration purpose of all the trained models, therefore, at the moment there are only 1 main features: Analyzing and giving feedbacks on user's exercise video.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License.
- Here are some other projects which I get inspired from: Pose Trainer, Deep Learning Fitness Exercise Correction Keras and Posture.
- Logo marker for this project.
- This awesome README template is from Best README Template. ♥