Skip to content

Latest commit

Β 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’ͺ AI Push-Up Counter (MediaPipe)

demo Python OpenCV MediaPipe

A real-time push-up counter using Computer Vision. The script analyzes the user's pose via webcam, tracks body landmarks, and automatically counts repetitions based on the vertical distance between the elbow and shoulder.


πŸš€ Features

  • Real-time Pose Detection: Uses Google's MediaPipe library to track 33 body landmarks.
  • Automatic Repetition Counting: Logic based on the Y-coordinate relationship between the elbow and shoulder.
  • Visual Feedback: * Displays a real-time "skeleton" (landmarks and connections).
    • HUD showing the current count and state (UP/DOWN).
    • Dynamic image overlay (reward effect) triggered upon successful completion of a push-up.
  • Efficient Logic: Simple state-machine approach to prevent double-counting.

πŸ› οΈ How It Works

  1. Preprocessing: The frame is captured via OpenCV, flipped for a mirror effect, and converted from BGR to RGB (required by MediaPipe).
  2. Landmark Extraction: The system identifies the LEFT_SHOULDER and LEFT_ELBOW points.
  3. Overlay System: When a repetition is counted, a timer (show_effect) is activated to display a custom image on the screen for 20 frames.

πŸ“‹ Requirements

  • Python 3.9+
  • Webcam
  • Libraries:
    pip install opencv-python mediapipe

About

Push up counting program

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages