GithubHelp home page GithubHelp logo

mohabz-911 / hand-gesture-recognition Goto Github PK

View Code? Open in Web Editor NEW
4.0 0.0 1.0 527.71 MB

Neural Networks and Pattern Recognition Project

License: MIT License

Python 0.10% PowerShell 0.01% Batchfile 0.01% Jupyter Notebook 99.89%

hand-gesture-recognition's Introduction

Hand Gesture Recognition 🤙

Given an image containing a single hand 🖐, our system classifies the hand gesture into one of six digits from 0️⃣ to 5️⃣. It handles different lighting effects⚡ and different hand poses as much as possible.

A complete machine learning pipeline, composed of the following modules:

  • Preprocessing
  • Feature extraction
  • Classification

Wait for the classification stage to see our magical touch ✨


Preprocessing

This module aims to handle the variation in the images color, texture, size, orientation and lighting conditions. It bridges the gap between different hands of same gesture by applying the following steps:

  • Resize the image for faster processing
  • Convert the image to HSV
  • Extract S and V channels
  • Get the thresholds of hand and apply it in both channels
  • Bitwise AND the two thresholded images
  • Filling the empty regions
  • Resize region filled mask to be compatable with original image size
  • Remove padding
  • Horizontally flip the image, if required
  • Extract OCR of the image from the previous step

Note: We tried about 🔟 other methods. This was the most robust one🤖


Feature Extraction

This module aims to describe the image with a constant size feature vector. We tried various options to achieve this. Here they are:

  • Using OCR extracted from the previous stage
  • Histogram of Oriented Gradients
  • SIFT (failed)
  • ORB (failed)

Classification

This module includes our trained model, or should we say our trained models

We mainly depend on two classical ML algorithms [Support Vector Machines - Random Forest]

  • Loads 3 different models
    • HOG descriptor, SVM
    • HOG descriptor, RF
    • OCR descriptor, SVM
  • Runs each of them on a single thread
  • Collects votes from them
  • Classifies the image according to the majority of votes

The model ouputs the HOG_SVM result in case a tie happens


How to run our model on your test set

# Clone this project
$ git clone https://github.com/{{YOUR_GITHUB_USERNAME}}/hand-gesture-recognition

# Access
$ cd Hand-Gesture-Recognition

# Install dependencies
$ pip install -r requirements.txt

# Go to the run directory
$ cd .\src\final

Put the expected.txt in the same directory

Put your images in the 'data' folder

It's better to label your images from 1 to n

# Go back to the root directory
$ cd ..\..\
# Run the following batch script
$ .\src\final\run.bat

# The results.txt and time.txt will be generated in the same directory
# The script will output the accuracy as well

Contributors ✨


Basma Elhoseny


Yasmine Ghanem


Mohab Zaghloul


Yasmin Elgendi

Feedback

If you have any feedback, please reach out to us at [email protected]

hand-gesture-recognition's People

Contributors

basmaelhoseny01 avatar mohabz-911 avatar yasmineghanem avatar yasminelgendi avatar

Stargazers

norhan reda avatar Abdelrahman Hamdy avatar Abdelrahman Hamza avatar Ahmed Sabry  avatar

Forkers

yasminelgendi

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.