Teach you how to do face recognition with Python, easy to learn!

Python is a computer programming language and accompanying software tools and libraries. Python is easy to learn, and the code is very concise. It uses mandatory blanks as indentation, which greatly improves the development efficiency of Python. Using Python can complete more work in a shorter time. Python is an open source language, and Python also has many powerful open source libraries, which enable Python to have strong support for cloud computing, big data, or artificial intelligence.

01. Face recognition

Face recognition is a typical and most successful recognition application in the field of computer vision.

Face recognition can be used in various application scenarios such as human-computer interaction, identity verification, and patient monitoring. First of all, it is necessary to find all the faces in the screen through face detection. By using the HOG algorithm for face detection and analyzing facial features, although the HOG algorithm can detect faces, it cannot recognize faces. The feature extraction of face recognition By training the convolutional neural network, 128 eigenvalues ​​are generated for each face. Changing the eigenvector can represent the face data well, so that the distance between the two eigenvectors of different faces is as large as possible, and the two eigenvalues ​​of the same face can be as large as possible. The eigenvectors should be as small as possible, so that face recognition can be performed through the eigenvectors.

picture

02、HOG

The main idea of ​​HOG is: in an image, the appearance and shape of the local target can be well distributed by the direction density distribution of the gradient or edge (that is, the statistics of the gradient, and the gradient is mainly located at the edge) describe. Several steps of the HOG feature detection algorithm: color space normalization —> gradient calculation —> gradient direction histogram —> overlapping block histogram normalization —> HOG feature. As shown below:

picture

 03 Dlib

The face recognition algorithm in Dlib is implemented based on Deep Convolutional Neural Networks (DCNNs). Among them, the model used to extract facial features is a convolutional neural network with 128-dimensional output, which uses the ResNet architecture (Residual Networks, residual network) for training.

picture

Guess you like

Origin blog.csdn.net/GUDUzhongliang/article/details/132066038