- Eli Ghosn
- Guilherme Leite
- Rafael Rosenzvaig
The code presents an implementation for face swapping, between two different images, using two well-known computer vision python libraries: dlib and OpenCV.
- Load 2 images that contain a human face on it
- Load pre-trained feature detection model
- Apply model on images to retrieve features coordinates
- Define facial area of interest using previously retrieved coordinates
- Split facial area of interest into tringles
- Cut facial region from both images and apply mask to remove the body from one image and the face from the other
- Warp masked face image to allign with masked body image
- Smooth edges to blend face into new body
- Retrieve final image