Skip to content

A lightweight, privacy-first, real-time rep counter for common bodyweight exercises. GC_Fit uses MediaPipe's Pose model and OpenCV to detect joint landmarks from a webcam feed and count repetitions of exercises (push-ups, sit-ups, squats) based on simple geometric rules.

License

Notifications You must be signed in to change notification settings

TheUnknown550/GC_Fit

Repository files navigation

GC_Fit

A lightweight, privacy-first, real-time rep counter for common bodyweight exercises. GC_Fit uses MediaPipe's Pose model and OpenCV to detect joint landmarks from a webcam feed and count repetitions of exercises (push-ups, sit-ups, squats) based on simple geometric rules.

Features

  • Push-up, Sit-up, and Squat rep counters using Pose landmarks.

Quickstart

  1. Create and activate a Python 3.8+ virtualenv.
  2. Install requirements: pip install -r requirements.txt
  3. Run an exercise script, for example:
python .\PushUp.py --time 30

If you want to run tests (optional):

pip install -r requirements.txt
python -m pytest -q

Notes

  • These scripts access your webcam. Grant permission if prompted.
  • Tune the angle thresholds or camera resolution for your setup.

Finding the correct camera

If the script opens a virtual camera (VCAM) instead of your physical webcam, find the correct camera index and pass it with --cam.

  1. Probe available devices (DirectShow on Windows):
.\.venv\Scripts\Activate.ps1
python list_cams.py --max 8

This prints which indices responded and the resolution. Commonly multiple indices show up (virtual cameras and real cameras). Note indices that report OK.

  1. Preview each working index visually:
python testcamera.py --max 6 --preview 4

This opens each index for a few seconds so you can visually identify your physical camera. Press q in the preview window to close early.

  1. Run the exercise script with the chosen index:
python PushUp.py --time 30 --cam 1

Tips and troubleshooting

  • If two indices both show 640x480, one may be a virtual camera. Close virtual camera apps (OBS, Zoom virtual camera, Snap Camera) and re-run testcamera.py.
  • On Windows, Device Manager (Cameras) can help identify installed camera drivers. Disabling a virtual camera temporarily can help determine the physical camera index.
  • If OpenCV can't open an index with the default backend, try the alternative backend in testcamera.py with --backend msmf.
  • Ensure no other app is blocking the webcam (Teams, Zoom, browser tabs). Close those apps and retry.

Contributing

  • Open an issue or a pull request. Keep changes small and focused.
  • Add tests for new functionality where practical.

License

  • MIT - see LICENSE

About

A lightweight, privacy-first, real-time rep counter for common bodyweight exercises. GC_Fit uses MediaPipe's Pose model and OpenCV to detect joint landmarks from a webcam feed and count repetitions of exercises (push-ups, sit-ups, squats) based on simple geometric rules.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages