In this chapter, we will cover the main topics in connection with face processing. In order to do so, we will be using the OpenCV library, but also the dlib (http://dlib.net/python/index.html, https://pypi.org/project/dlib/, https://github.com/davisking/dlib), face_recognition (https://pypi.org/project/face_recognition/, https://github.com/ageitgey/face_recognition) and cvlib (https://pypi.org/project/cvlib/, https://github.com/arunponnusamy/cvlib, https://www.cvlib.net/) Python packages. In the previous section, you saw how to install these packages.
In order to introduce this chapter, we will be using different approaches throughout all the sections to see the different possibilities you have at hand to solve a concrete face processing task, and it can be helpful to have a high-level overview of all of these alternatives.
This diagram attempts to capture the concept of the previously mentioned topics:
As you can see, four main points are going to be tackled here:
- Face detection is a specific case of object detection, where the task is to find both the locations and sizes of all the faces in an image.
- Facial landmarks detection is a specific case of landmarks detection, where the task is to locate the main landmarks in a face.
- Face tracking is a specific case of object tracking, where the task is to find both the locations and sizes of all the moving faces in a video by taking into account the extra information that can be extracted in consecutive frames of the video.
- Face recognition is a specific case of object recognition, where a person is identified or verified from an image or video using the information extracted from the face:
- Face identification (1:N): The task is to find the closest match from an unknown person in a collection of known faces.
- Face verification (1:1): The task is to check whether the person is who they claim to be.
As you can see in the previous diagram, OpenCV, dlib, face_recognition, and cvlib, are going to be used throughout this chapter.