An application that uses OpenPose to assist with Gym Exercises
Many people who being exercising lack professional guidance. They tend to miss out on a lot of potential gains either by performing the exercise incorrectly or by having poor posture while doing it. In some cases they may even end up doing more harm than good.
This application aims to help in that regard by helping and guiding when performing a variety of exercises.
Program runnning on Bicep Curls.
It gives instructions and also points out poor posture.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
git clone https://github.com/shaunferns26/AI-Gym-Trainer.git
To install openpose, you can follow any of the install instructions on their github repo, But ensure that the version you compile has Python API support.
Also bear in mind that OpenPose has a lot of dependencies, so running a premade Docker container will definately save you a lot of trouble.
An easier way to get OpenPose running is to simply build an openpose docker image from the Dockerfile provided in this repo and run the python program in the docker container.
cd AI-Gym-Trainer
docker build -t openpose_python .
# Or give the docker image any name you want
Most of these options are for sharing the PC's webcam with the Docker container, and to display a window from a program running in the container on your desktop. You may need to adjust these to match your settings.
You may also want to mount this project's directory or any other local directory into the Docker container, for your convenience.
docker run --gpus all -it --name openpose_python -e NVIDIA_VISIBLE_DEVICES=0 \
--device=/dev/video0:/dev/video0 --net=host --env="DISPLAY" \
--volume="$HOME/.Xauthority:/root/.Xauthority:rw" \
openpose_python
docker start -i openpose_python
Once you have open pose installed, running the script is simple.
Just copy the file GymTrainer.py
to the folder:
openpose/build/examples/tutorial_api_python/
And run it:
python3 GymTrainer.py