This application uses computer vision to detect and count workout repetitions in real-time, focusing on arm exercises like bicep curls.
- Clone this repository:
git clone https://github.com/yourusername/workout-rep-counter.git
cd workout-rep-counter
- Install the required dependencies:
pip install -r requirments.txt
Run the main script:
python main.py
This will open your webcam feed and start tracking your movements.
-
Real-time Pose Detection: Uses MediaPipe to detect and track body landmarks.
-
Angle Calculation: Calculates angles between key body points (shoulder, elbow, wrist) to determine arm position.
-
Rep Counting: Counts repetitions for arm exercises (e.g., bicep curls) based on arm angles.
-
Bilateral Tracking: Tracks both left and right arms simultaneously.
-
Visual Feedback: Displays rep count, current arm states, and angle measurements on the video feed.
-
FPS Display: Shows the current frames per second for performance monitoring.
- The application captures video from your webcam.
- It detects body landmarks using the PoseDetector class.
- Angles between the shoulder, elbow, and wrist are calculated for both arms.
- The state of each arm (up or down) is determined based on these angles.
- A rep is counted when a full motion cycle is completed.
- Real-time information is displayed on the video feed.
- Adjust the angle thresholds in the main script to fit different exercises or body types.
- Modify the PoseDetector class parameters for different detection sensitivities.
- Ensure good lighting for accurate pose detection.
- Wear contrasting clothes to your background for better landmark detection.
- If the application runs slowly, try reducing the resolution of your webcam feed.
Contributions, issues, and feature requests are welcome. Feel free to check issues page if you want to contribute.