Face Landmark Estimation Application

Muhammad Rizwan Khan
Coinmonks
4 min readOct 30, 2018

--

After detecting a face in an image, as seen in the earlier post ‘Face Detection Application’, we will perform face landmark estimation. Face landmark estimation means identifying key points on a face, such as the tip of the nose and the center of the eye.

There are different estimation models based on the number of face landmark points. The 5 points model is the simplest one which only detects the edges of each eye and the bottom of the nose.

5 points face landmark model

Other models include 68 points face landmark model which detects 68 different points on the face including eyes, nose, lips and face shape.

68 points face landmark model

Face landmark estimation helps to build applications for applying digital makeup or widgets.

Build an Application for Estimating Facial Features

We will use face_recognition model build using ‘dlib’ library for our application. ‘dlib’ is principally a C++ library, however, we can use a number of its tools for python applications. face_recognition is a deep learning model with accuracy of 99.38%.

For more details and references, please visit:

face_recognition has built in functions to perform face detection, recognition and identification tasks. First, we will load the image into a NumPy array and apply face_landmarks function. face_landmarks function returns a list of all faces in the image. Each face is further having ‘name’ and ‘list of points’ for all facial feature of the face. Using the landmarks of each facial feature (eyes, nose, lips…etc.), we will draw red color lines around the facial features.

Note: The below code requires three Python external libraries pillow, face_recognition and dlib.

Below is the output of above code on different images.

As you can see in the above images, the facial features are marked very precisely. We can further extend our application to apply digital makeup, widgets (glasses, masks…etc.) and so on. The author of the face_recognition and the reference to this article, Adam Geitgey, has provided many examples on his GitHub repository. I strongly recommend everyone to attend his course.

Also read: Face Landmark Estimation in a Live Video

Reference:

Deep Learning: Face Recognition by Adam Geitgey

Get Best Software Deals Directly In Your Inbox

--

--