yoga / README.md
randomshit11's picture
Upload 167 files
97e3689 verified

Logo

Exercise Pose Correction

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.

About The Project

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

    Logo

  • Basic Plank

    Logo

  • Basic Squat

    Logo

  • Lunge

    Logo

  • Models' evaluation results and website screenshots here

(back to top)

Built With

  1. For data processing and model training

  2. For building website

(back to top)

Dataset

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.

Getting Started

This is an example of how you may give instructions on setting up the project locally.

Setting Up Environment

    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.

Installation

If you only want to try the website, look here.

  1. Clone the repo and change directory to that folder

    git clone https://github.com/NgoQuocBao1010/Exercise-Correction.git
    
  2. Install all project dependencies

    pip install -r requirements.txt
    
  3. Folder core is the code for data processing and model training.

  4. Folder web is the code for website.

(back to top)


Usage

As the introduction indicated, there are 2 purposes for this project.

  1. Model training (describe in depth here). Below are the evaluation results for each models.

    • Bicep Curl - lean back error: Confusion Matrix - ROC curve
      Bicep Curl evaluation NgoQuocBao's Top Languages
    • Plank - all errors: Confusion Matrix - ROC curve
      Plank evaluation NgoQuocBao's Top Languages
    • Basic Squat - stage: Confusion Matrix - ROC curve
      Squat evaluation NgoQuocBao's Top Languages
    • Lunge - knee over toe error: Confusion Matrix - ROC curve
      Lunge evaluation NgoQuocBao's Top Languages
  2. 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.

    Logo

    Logo

    Logo

    Logo

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License.

(back to top)

Acknowledgments

(back to top)