Face Recognition Using dlib’s State Of Art ‘face_recognition’

Published On: 10 April 2020.By .
  • General

Face Recognition

Recognize and manipulate faces from Python or from the command line with the world’s simplest face recognition library. Built using dlib’s state-of-the-art face recognition built with deep learning. The model has an accuracy of 99.38% on the Labeled Faces in the Wild benchmark.

This also provides a simple face_recognition command-line tool that lets you do face recognition on a folder of images from the command line!

Installing Dlib

1. Install os libraries

2.install python libraries

We will use Virtual Environment to install Python libraries. It is generally a good practice in order to separate your project environment and global environment

Dlib installation without GPU support

or you can compile the following code

Installing dlib with GPU support (optional)

If you do have a CUDA compatible GPU you can install dlib with GPU support, making facial recognition faster and more efficient.

For this, I recommend installing 

Install the face_recognition package

Install imutils( You’ll also need my package of convenience functions, imutils. You may install it in your Python virtual environment via pip)

Now we can see the project setup, hit command tree in the directory containing the project

In the dataset we create folders for every person and to create encodings we put images of those people to prepare encodings for.

We prepare encodings by running encode_faces.py

And encodings are saved in encodings.pickle file

Results demo:-

Related content

That’s all for this blog