In this post I’ll show you how to create Face Recognition in 5 line with Python by using deep learning. Face Recognition and Detection is mostly the first project of any ML or AI student. Now you no need to write thousand of lines to perform this simple task.

Github: https://gist.github.com/Dipeshpal/ed0431234f1c8873249cfdd5f4dc88e4


Content-

  1. What is Face Recognition
  2. What is Face Detection
  3. Introduction of ‘auto_face_recognition’ python library
  4. How things works
  5. Code
  6. Future Updates
  7. Resources and GitHub Code

1. What is Face Recognition-

In simple words, identify individual faces / person’s face.

According to Wikipedia- A facial recognition system is a technology capable of identifying or verifying a person from a digital image or a video frame from a video source.

Image for post

Face Recognition

2. What is Face Detection

In simple words, detecting faces of humans. Detection doesn’t means recognition, only finding features of human face from image or video.

According to Wikipedia- Face detection is a computer technology being used in a variety of applications that identifies human faces in digital images. Face detection also refers to the psychological process by which humans locate and attend to faces in a visual scene.

Image for post

Source: https://files.realpython.com/media/face-detection-abba.ea2dcc6d3bda.jpg

3. Introduction of ‘auto-face-recognition’ python library

It is the python library created by me, I want to reduce the complexity of this task, so that’s why I have created this library. Will talk about its working later.

You can check official Pypi page of this library here: https://pypi.org/project/auto-face-recognition/

Install the latest version- pip install auto-face-recognition

About auto-face-recognition: It is a python library for the Face Recognition. This library make face recognition easy and simple. This library uses Tensorflow 2.0+ for the face recognition and model training.

Prerequisite- To use it only Python (> 3.6) is required.

4. How things works-

Generally machine learning architecture follow few steps- data gathering, preprocessing, training, then prediction on unseen data with exported model.

Image for post

ML Architecture

What if this data gathering, training and prediction can be done using few lines of code for Image Recoginition.

The answers is yes, its possible using auto-face-recognition.

5. Code-

This is the complete code you need-

import auto_face_recognition

obj = auto_face_recognition.AutoFaceRecognition()

obj.datasetcreate(haarcascade_path='haarcascade/haarcascade_frontalface_default.xml',
                  eyecascade_path='haarcascade/haarcascade_eye.xml',
                  class_name='Dipesh')
obj.face_recognition_train()
obj.predict_faces(class_name=['Dipesh', 'Jay'], color_mode=True)

Medium Article: https://medium.com/@dipeshpal17/39a5bf798267

#python #deep-learning #artificial-intelligence #machine-learning #developer

How to Create Face Recognition in Python using Deep Learning
3.15 GEEK