Face recognition is not that difficult, 1 line of commands can be achieved

Now that face recognition is so hot, major mobile phone manufacturers are also rushing to add this technology to their mobile phones. So, is face recognition technology really difficult, but it is not. Here's how to implement face recognition technology with a 1-line command. Let’s take a look!

Environmental requirements

Ubuntu 17.10

Python 2.7.14

Environmental construction

1. Install Ubuntu17.10.

2, install Python2.7.14 (Ubuntu17.10 default Python version is 2.7.14)

3, install git, cmake, python-pip

Face recognition is not that difficult, 1 line of commands can be achieved

4, install and compile dlib

Before installing face_recogniTIon, you need to install and compile dlib.

Face recognition is not that difficult, 1 line of commands can be achieved

5, install face_recogniTIon

Face recognition is not that difficult, 1 line of commands can be achieved

After the environment is set up, enter the face_recogniTIon command on the terminal to check whether it is successful.

Face recognition

Example 1 (1 line command for face recognition):

1. First you need to provide a folder with pictures of all the people you want the system to know. Each of them has a picture, and the picture is named after the person:

Face recognition is not that difficult, 1 line of commands can be achieved

Photos of babe, Jackie Chan, Joey Yung under the known_people folder

2. Next, you need to prepare another folder with the image you want to identify:

Under the unknown_pic folder is the image to be recognized, in which Han Hong is not recognized by the machine.

3, then you can run the face_recogniTIon command, the two folders just prepared as parameters, the command will return to the image that needs to be identified:

Face recognition is not that difficult, 1 line of commands can be achieved

Recognition success! ! !

Example 2 (recognize all faces in the image and display them):

Face recognition is not that difficult, 1 line of commands can be achieved

Face recognition is not that difficult, 1 line of commands can be achieved
Face recognition is not that difficult, 1 line of commands can be achieved

Image for identification

Face recognition is not that difficult, 1 line of commands can be achieved

Identify 7 faces from the image and display them

Example 3 (automatic recognition of face features):

Face recognition is not that difficult, 1 line of commands can be achieved

Face recognition is not that difficult, 1 line of commands can be achieved

Automatic recognition of facial features

Example 4 (Identify who is the face identification):

Face recognition is not that difficult, 1 line of commands can be achieved

Display results as shown

Example 5 (identifying facial features and beauty):

Face recognition is not that difficult, 1 line of commands can be achieved

Face recognition is not that difficult, 1 line of commands can be achieved

Canaan AvalonMiner

Canaan is a leading provider of supercomputing solutions, distinguished for superior cost-efficiencies and performance. In addressing the limitations of today`s computing hardware, Canaan strives to advance the world we live in by powering transformative technologies.


Canaan is renowned for having invented the world`s first ASIC-powered Bitcoin Mining Machine in 2013, radically catalysing the growth of a computationally-advanced bitcoin mining sector.

Developed through academic research, rigorous expertise in semiconductor design, and backed by a robust network of strategic partners, Canaan continues to expand its suite of advanced hardware offerings, exploring opportunities across some of the world`s most exciting emerging technologies.


Canaan AvalonMiner:Canaan AvalonMiner 821,Canaan AvalonMiner 841,Canaan AvalonMiner 741,Canaan AvalonMiner 1246,Canaan AvalonMiner 921,Canaan AvalonMiner 1166 Pro

Canaan Avalonminer,1166 Pro 66T,Avalon 821,Avalon 1246,avalon miner

Shenzhen YLHM Technology Co., Ltd. , https://www.hkcryptominer.com