Git Product home page Git Product logo

face-recognition-real's Introduction

Face-recognition-real

Face recognition with eye detection

Installation

  1. Install python3
On MacOs  
brew install python3  
On Ubuntu  
sudo apt-get install python3  
  1. Setup a virtual environment in the folder sudo pip3 install virtualenv
    virtualenv myenv
    source myenv/bin/activate

  2. Install requirements pip3 install -r requirements.txt
    ├── pandas
    ├── numpy
    ├── sklearn
    ├── flask
    ├── flask_cors
    ├── imutils
    ├── cmake
    ├── dlib
    ├── opencv-python

Folder structure

├── dataset
│   └── harshith
├── detect_blinks.py
├── extract_embeddings.py
├── face_detection_model
│   ├── deploy.prototxt
│   └── res10_300x300_ssd_iter_140000.caffemodel
├── facerecog_v2.py
├── face_registration.py
├── flask_backend.py
├── haarcascade_frontalface_default.xml
├── openface_nn4.small2.v1.t7
├── output
│   ├── embeddings.pickle
│   ├── le.pickle
│   └── recognizer.pickle
├── pycache
│   └── flask.cpython-37.pyc
├── README.md
├── recognize.py
├── recognize_video.py
├── requirements.txt
├── shape_predictor_68_face_landmarks.dat
├── test
│   └── test.png
└── train_model.py

Tasks

  • Face registration (collecting images)
  • Face recognition with blink detection

Dataset: Labelled faces in the wild Download

Face registration

  1. For using a custom dataset, run python3 face_registration.py --name [person_name] to collect images of a person in folder dataset/[person_name]
  2. Extract embeddings from an image python3 extract_embeddings.py. The embeddings are stored in the path output/embeddings.pickle

Added flask server to make an api call
python3 facerecog_v2.py

Eye and mouth detection

  • Using face alignment [2] to get the facial landmarks and using [1] to compute eye aspect ratio to identify eye blinking.
  • This is to avoid spoofing attacks by clearly differentiating a real person's face and an image of the person

Blink detection

Face recognition

  • Generate 128-d embedding of each person's image in the dataset.
  • Train the SVM model for classification
  • Testing: Generate the embedding of the person you want to recognize and compute the similarity between test person's embedding and pre-computed embedding.

References

  1. Real time eye detection
  2. Face alignment
  3. Shape predictor dataset
  4. FaceNet
  5. dlib pretrained models

face-recognition-real's People

Contributors

saiharshithreddy avatar

Stargazers

 avatar  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.