There are many different face recognition libraries, but face_recognition is quite accurate & Easy to use. This article introduces how to install and use the face_recognition lib on Windows. The name of this lib does not have a brand name that is named with a generic keyword, so I will abbreviate it as FR.
This article only focuses on using the lib, but the build lib will be written in another post.
This is an open source project written in Python, using Dlib for facial recognition. However, currently installing with the command on the lib homepage is faulty, so I will provide another way to install it.
The problem is that dlib and the latest FR version are not compatible with each other. Therefore, it is necessary to specify the appropriate version to install.
This article uses Python 3.6.5 amd64 to test (Windows x86-64 executable installer).
You copy the content below and save it as a requirement.txt file
Then type the command below to install the packages specified in the requirements.txt file
pip3 install -r requirements.txt
Waiting for the packages to be installed.
3. Test the source code
You can download the example files from the github repo for testing: https://github.com /ageitgey/face_recognition/tree/master/examples
In it, there are easy-to-understand example files available:
– face_distance.py find the difference between 2 faces, the smaller the number, the more similar
– find_facial_features_in_picture.py find facial features
– recognize_faces_in_pictures.py load Obama and Biden images, then take another photo of Mr. Obama to compare
4. Download the source code