GithubHelp home page GithubHelp logo

aascode / openpose-gesture-recognition Goto Github PK

View Code? Open in Web Editor NEW

This project forked from faaip/openpose-gesture-recognition

0.0 0.0 0.0 1.65 MB

Cognitive Science 2 exam project

Jupyter Notebook 97.35% Python 2.52% Shell 0.13%

openpose-gesture-recognition's Introduction

OpenPose-Gesture-Recognition

Made with @vhargitai and @mxmxxl

In this project we made a hand gesture classifier, to classify the videos from the 20bn jester dataset

Instead of making a classifier from the ground up, we decided to use the OpenPose posture recognition framework from Carnegie Mellon University's Perceptual Computing Lab for representation. Using both the body and hand models, OpenPose allowed us to extract body- and hand pose keypoints from videos or images.

We then trained a long-short term memory recurrent neural network classifier on the sequence of keypoints extracted from each frame of the videos.

Our working pipeline worked as follows:

  1. Parse as many videos as we could using OpenPose
  2. Some data preprocessing, since not every video was succesfully parsed
  3. Train the LSTM classifier

Parsing of videos

Parsing is done using run_openpose.py. Here we input a video directory, which contains all frames as images, and run a subprocess that calls the actual openpose command. See the scripts/openpose.sh file for the flags we have used. Note that we use a OpenPose Docker, so the flags might be a bit different than in the newer versions. OpenPose outputs a directory of json files (one for each frame). After this we combine the jsons into one big json file.

Data Preprocessing

OpenPose was unfortunately unable to find people and extract their pose keypoints from a few videos (these were often cases that would be challenging for humans as well). We decided to prune the videos to make it easier for our classifier. Nex, we transformed the successful json outputs into a numpy array. See the notebook RNN/Data Preprocessing.ipynb for the criterion and transforming of the json files. In our case we eventually had $17054$ samples in our dataset.

Training the Classifier

The architecture of the LSTM RNN is based on guillaume-chevalier's. We also save performance summaries and the best performing models. See RNN/Our Classifier.ipynb for our implementation.

For training of the classifier, we randomly split our data into a training set of $14000$ and a test set of $3054$.

Results

Our classifier had a test accuracy of around $50%$. Note that this classifier was trained on a random sample consisting of only $10%$ of the total 20bn jester training dataset - we believe that a higher accuracy could be achieved with more data.

openpose-gesture-recognition's People

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.