Git Product home page Git Product logo

rep-counter's Introduction

RepCounter

This repository is a fork of posenet-python(https://github.com/rwightman/posenet-python) RepCounter uses posenet to analyse different points and count repetitions. This is highly skilled in counting no of reps of exercises.

Working demos

Demo1 Demo2 Demo3

Install

A suitable Python 3.x environment with a recent version of Tensorflow is required. Development and testing was done with Conda Python 3.6.8 and Tensorflow 1.12.0 on Linux. All prerequisitites can be found in the requirements.txt file. It is adviced that you install them in a virtual environment.

  • Installation in Virtual Environment

    It is recommended that you use virtualenv and virtualenvwrapper to maintain a clean Python 3 environment. Create a virtualenv and install the requirements:

    $ mkvirtualenv -p python3 repCounter
    (badgeyay) $ deactivate         			# To deactivate the virtual environment
    $ workon repCounter             			# To activate it again
    (badgeyay) $ pip3 install -r requirements.txt 	# Install the requirements
  • System Wide Installation

    pip3 install -r requirements.txt

    Note: This might change versions of exisiting python packages and hence is not recommended.

Usage

Run the app in eye candy mode with:

python3 run.py

Usage information:

usage: run.py [-h] [--variance VARIANCE] [--model MODEL] [--cam_id CAM_ID]
              [--cam_width CAM_WIDTH] [--cam_height CAM_HEIGHT]
              [--scale_factor SCALE_FACTOR] [--file FILE]

optional arguments:
  -h, --help            show this help message and exit
  --variance VARIANCE   The tolerance for the model in integers
  --model MODEL         The model to use, available versions are 101 (def.),
                        102, 103 etc
  --cam_id CAM_ID       The respective cam id to use (default 0)
  --cam_width CAM_WIDTH
                        The width of the webcam in pixels (def. 1280)
  --cam_height CAM_HEIGHT
                        The height of the webcam in pixels (def. 780)
  --scale_factor SCALE_FACTOR
                        The scale factor to use (default: .7125)
  --file FILE           Use the video file at specified path instead of live
                        cam

The first time the apps is run (or the library is used) model weights will be downloaded from the TensorFlow.js version and converted on the fly.

The model can be specified with the '--model` argument by using its ordinal id (0-3) or integer depth multiplier (50, 75, 100, 101). The default is the 101 model.

Count can be reset by pressing r or R on the keyboard. Exit the app by pressing the q or Q on the keyboard.

Credits

This repository is a fork of posenet-python (https://github.com/rwightman/posenet-python)

The original model, weights, code, etc. was created by Google and can be found at https://github.com/tensorflow/tfjs-models/tree/master/posenet

This work is in no way related to Google.

rep-counter's People

Contributors

abishekvashok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rep-counter's Issues

Error when opening webcam

I keep getting this error:

Traceback (most recent call last):
  File "run.py", line 128, in <module>
    main()
  File "run.py", line 81, in main
    input_image, display_image, output_scale = posenet.read_cap(
  File "/Users/username/Downloads/Rep-Counter/posenet/utils.py", line 28, in read_cap
    raise IOError("webcam failure")
OSError: webcam failure

Any idea why, and how to fix it? Thanks!

AttributeError: module 'tensorflow' has no attribute 'Session'

I tried to reinstall every package again however, I wasn't able to run the program. I will now change the run.py to see if there is something wrong with the tf.Session part. However, I am down for any solutions without changing the "run.py". Thanks!

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.