This project helps track and improve push-up form by detecting repetitions and correctness in real-time.
I built it to learn computer vision - and also to improve my own push-ups (I'm using this program daily)
- The program counts how many correct push-ups you do in real time
- A push-up is considered correct if:
- the elbow angle goes below 90° when going down
- and it exceeds 145/155° when going up
- At each step the program tells you when to go down / up, so that you are on the correct pace.
- You could also make the push-ups harder by adjusting 'valid_frames' value (from 1 to 5 / 6 or 10).
- The higher the value, the longer you must hold the “up” or “down” position.
- Also if you want to reset the counter you can just clap once and it resets to 0.
- Python
- MediaPipe - i'm using only 3 * 2 keypoints : left/right shoulder, elbow and wrist
- OpenCV - camera input
- note that my camera is only 1280x720, if yours is 1920x1080 adjust the resolution : CAMERA_WIDTH / CAMERA_HEIGHT
- Clone the repository:
git clone https://github.com/RadwB2112/RealTimeCorrectPushUpCounter.git cd RealTimeCorrectPushUpCounter - Install the requirements
pip install -r requirements.txt
- Run the program and start doing push-ups )))
python3 main.py