Giter Site home page Giter Site logo

facerecognition's Introduction

Face Recognizer

Face Recognizer indentifies the face of an individual by their name with the help of their facial features.

Face Recognizer uses deep learning algorithms to compare a live capture or digital image with the stored faceprints(also known as datasets) to verify an identity.

The algorithm used for classification is k-NN model i.e. k-Nearest Neighbor classifier. It uses Euclidean distance to compare images for similarity.

Prerequisites

Build and install dlib library

git clone https://github.com/davisking/dlib.git
mkdir build
cd build
cmake ..
cmake --build
cd ..
python setup.py install

Setup

pip install -r requirements.txt

Set the path of the input images in the code and run the following command:

python FaceRecognizer.py

How Does It Work?

  • An image that contains the face to be recognized is loaded (e.g., input image).
  • The face is detected and cropped.
  • The face is aligned if it is not aligned straight
  • Landmarks (e.g., 68 (x, y) coordinates) are detected that map to the facial structures on the face.
  • The detected face is encoded (e.g., 128-d embeddings of the image are created).
  • The input image[encoding] is passed to the k-NN model for classification.
  • The k-NN model returns the name with the highest votes

Outputs:

  • Input Image - The image in which faces are to be recognized:

Input Image

  • Original Image - The cropped input image

Original Image Original Image!

  • Aligned Image - Aligning the image increases the efficiency of the algorithm

Aligned image Aligned Image

  • Landmarks - Shows the landmarks of the detected faces

Landmark

  • Detected Face - The face is recognized and the name of the recognized face is displayed along with the face. If the face does not belong to the dataset then the face is labeled as Unknown.

Detected face




Another Recognition:

  • Input Image:

Input Image

  • Original Image:

Original Image

  • Aligned Image:

Aligned Image

  • Landmarks :

Landmarks

  • Detected Face :

Detected Face


encode-faces.py

It is used to create 128-d face embeddings of the input image as well as custom dataset. These embeddings are used to compare input image(embeddings) with the dataset(embeddings). The one with the highest votes is preferred.

DAT file

Link to Download Dat File

Resources

facerecognition's People

Contributors

riya-17 avatar ritwik12 avatar kshitijkhune avatar kmnft avatar anshulll avatar ramazanm avatar thethaa avatar ishanisri 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.