AI SQUAT COUNTER : Python 3.11 - Core language Yolo - Real time Keypoint(Body) detection OpenCV - Webcam feed Numpy - Angle calculation which uses your webcam to track the number of squats done. Uses Python as the core language Uses YOLO to detect 17 body keypoints on your body every frame Calculates the knee angle using hip → knee → ankle coordinates State machine tracks UP (angle > 165°) and DOWN (angle < 55°) Rep is counted when you return from DOWN back to UP Jump detection tracks hip velocity — if hips move up faster than 400px/sec it shows "ONLY DO A SQUAT" and blocks the count Ignores angles when sitting by checking if ankle is properly below the knee
|Stand sideways with your left side facing the camera. Thresholds are tuned for side view — front facing won't work accurately.| Full body must be visible — head to feet YOLO model(Detects the body movement) downloads automatically on first run Press Q to quit
To run it locally! - Requirements:
Windows / Mac / Linux A webcam Python 3.11 — download from python.org/downloads VS Code — download from code.visualstudio.com
Step 1 — Clone the repo git clone "Repo link" cd squat_counter
Step 2 — Create virtual environment py -3.11 -m venv squat_env
Step 3 — Activate it Windows: squat_env\Scripts\activate Mac/Linux: source squat_env/bin/activate
Step 4 — Install dependencies pip install opencv-python ultralytics numpy
Step 5 — Run python squat_counter.py