Giter Club home page Giter Club logo

stance's Introduction

Stance

Determining the similarity between abstract scenes is a difficult problem in cognitive computing. Humans can look at two images or videos and immediately tell if they are similar, but this intuition is difficult to encode.

We present an application of 2D human pose estimation for accessing similarity between motions in the space of weightlifting. Given input video of a person performing an exercise, our system will access their form. That is, it will give a similarity score between the user's motion and that motion performed "ideally".

Installation

Clone the public repository

git clone https://github.com/RFinkelberg/Stance.git

Use the package manager pip to install the dependencies

pip install -r requirements.txt

Download the neural net

python get_models.py

Quick Start

cd stance/
python main.py -f example/squat.mp4

Usage

usage: main.py [-h] [-f VIDEO_PATH] [-v] [-p]

optional arguments:
  -h, --help            show this help message and exit
  -f VIDEO_PATH, --video_path VIDEO_PATH
                        filepath to video containing the user performing a
                        motion
  -v, --verbose         Verbosity level. 1 (v) displays info, 2 (vv) displays
                        debug logs
  -p, --use_pickle      uses the pickle file corresponding to the video file
                        given
  -s, --save_pickle     makes a pickle file corresponding to the video file
                        given

Using Pickle Files

There are three pickle files each containing precomputed skeletons for each frame of the videos. To use, simply attach a "-p" to the end of the command with the relevant video file.

  • example/squat.mp4
  • example/squatbad.mp4
  • example/squatpoop.mp4
python main.py -f example/squatbad.mp4 -p

Saving a Pickle File

If you would like to save the output of the neural net to pickle file so the system spends less time computing the user skeletons of the video in future runs, simply attach a "-s" to the end of the command.

python main.py -f example/squat.mp4 -s

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Development

For more information on how we developed this project, check out our stance website.

stance's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

jbeta51

stance's Issues

Refactor benchmark zones

The way we do benchmark zones needs to be changed. We can't have a bunch of basically unnamed functions floating around for each motion

Create motion class

Each motion instance has:

  • benchmark zones and functions to create skeletons for them
  • skeleton similarity function
  • scoring function

Reference needed for `template_fit` code

The entirety of get_points_from_image came from that one tutorial. In the header of the file we need to say that, credit the author, and link to the original code.

Implement Type Annotations

Currently some files have type hints and some do not. All of them should have consistent, mypy compliant type annotations

Implement Logging

Currently we have random print statements describing the state of the program. These need to be replaced with an actual logger

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.