Weightlifting is a popular form of exercise that can help you lose fat, increase your strength and muscle tone, and improve your bone density. You don't have to be a bodybuilder or professional athlete to reap the benefits of weightlifting, but you do need to be aware that if done incorrectly, weightlifting carries a risk of injury, especially if you don't use the correct form.
This repository presents a set of tools to help you improve your weightlifting form. It does so by analyzing a video of your workout, estimating your pose with a AI model (mediapipe-blazepose) and giving you feedback on your form.
Although the repository is designed to be used with any weightlifting exercise, it currently only supports the front squat exercise. However we are working on adding more exercises to the repository. See Project Roadmap for more information.
- Clone this repository.
git clone https://github.com/LoboaTeresa/AI-Trainer.git
- Install the requirements.
pip install -r requirements.txt
- Run the script
python3 main.py --input_video <input_video>
For more information, check out the documentation.
For this project we use the Mediapipe Blazepose full model. This model is a pose detection model that infers 33 3D landmarks or keypoints on the full body (ckeck figure below). It is based on the BlazePose paper, which you can find here.
The specifications of the model are gathered in the model card.
Although this repository is designed to be used with any weightlifting exercise, it currently only supports the front squat exercise. However we are working on adding more exercises to the repository.
Some ideas on how to improve this project are:
- Add more exercises. E.g. deadlift, bench press, etc.
- Add automatic rep counting.
- Add exercise classification/identification.
- Add a web/mobile app to make it more user friendly.
- Analyze the the position of the barbell.
I would like to thank Sngular (Github) for the green space they gave me to develop this project. I would also like to thank my college (and unofficial mentor), Mate, for some code snippets as well as his motivation and knowledge pills he shares daily. Love working with you, mate! (pun intended😉). Check out his Github, he has some amazing CV and MLOps projects.