In this workshop, we’ll show you how to automate the process of swapping faces between any two images with high precision. To do this we’ll use the dlib library to detect facial landmark points and create triangulated maps of both faces in code (to ensure maintenance of perspective, size, and proportion). Following this, we’ll use OpenCV to warp and transfer the triangular components from one image to the other. Once we have completed this process, we can easily adapt our code to work on live video—all without any human intervention as the program handles everything.
Precision Image Face Swapping with OpenCV
In this workshop, we’ll show you how to automate the process of swapping faces between any two images with high precision. To do this we’ll use the dlib library to detect facial landmark points and create triangulated maps of both faces in code (to ensure maintenance of perspective, size, and proportion). Following this, we’ll use OpenCV to warp and transfer the triangular components from one image to the other. Once we have completed this process, we can easily adapt our code to work on live video—all without any human intervention as the program handles everything.
Prerequisites: