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
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.
Face Recognition
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.
Source: https://files.realpython.com/media/face-detection-abba.ea2dcc6d3bda.jpg
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.
Generally machine learning architecture follow few steps- data gathering, preprocessing, training, then prediction on unseen data with exported model.
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.
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