Giter VIP home page Giter VIP logo

gymbuddy's Introduction

GymBuddy - Your Personal Trainer with Human-Pose Estimation

This Python script uses the trt pose library and OpenCV to detect and track human pose from a webcam feed. It can be used as a foundation for various applications, including personal fitness training, yoga posture detection, or even just as a fun tool to learn more about computer vision.

trt_pose: https://github.com/NVIDIA-AI-IOT/trt_pose

Table of Contents

  1. Installation
  2. Basic Usage
  3. Pose Detection
  4. Calculating Angles
  5. Curl Counter

1. Installation

Before using this script, you need to install the required dependencies. You can do this by running the following command:

!pip install opencv-python

2. Basic Usage

The script captures video from your webcam, detects the human pose, and visualizes it on the screen. You can stop the script by pressing 'q' while the video feed window is active.

3. Pose Detection

The script uses the MediaPipe library to detect and track the human pose. It uses the following landmarks to identify the body's position:

Left Shoulder Left Elbow Left Wrist These landmarks help in calculating the angle of the arm during specific exercises or poses.

4. Calculating Angles

The calculate_angle function in the script calculates the angle between three points (shoulder, elbow, and wrist). It is used to measure the angle of the arm during exercises or poses.

5. Curl Counter

The script includes a curl counter feature that counts how many times a specific motion is performed. It counts the number of curls based on the angle of the arm and changes in position. The current count and stage (up or down) are displayed on the screen.

Feel free to modify and build upon this script to create your own personal trainer or fitness-tracking applications!

Enjoy using GymBuddy :)

gymbuddy's People

Contributors

zoreanuj avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.