Count the number of repetitions for 3 exercises: bench press, overhead press and dumbbells curl
- Using mediapipe process video, detect body landmarks and write it into the csv (data_engineering.py).
- Train RandomForestClassifier on created csv with four classes: 'bench', 'curl', 'overhead' and 'other'(ml_model.py).
- Process a new video, classify the detected pose using the model (rf_classifier.pkl) and based on the classification calculate the angle of elbow and shoulder (calc_angle.py).
- If the calculated angle exceed a certain threshhold, increase counter by 1.
- Clone this repository
- Install the requirements using pip
- Run the following command in the command line
--input_video_path
- path to the input video--output_video_path
- path to the output video, if not specified the video will be created in the same directory as input video--draw_pose
- if set to1
the detected poses will be drawn, default is0
--info
- if1
the probabilities of pose classification ([[prob_bench, prob_curl, prob_overhead, prob_other]]
), elbow and shoulder angles, as well as which hands is used for calculating the angle will be shown, default is0
git clone https://github.com/ArtLabss/workout-tracking.git
pip install -r requirements.txt
python prediction.py --input_video_path=Input/bench_test.mp4 --output_video_path=Output/video_output.mp4 --draw_pose=0 --info=0
If you stumble upon an error or have any questions feel free to open a new Issue