Reader small image

You're reading from  Exploring Deepfakes

Product typeBook
Published inMar 2023
Reading LevelBeginner
PublisherPackt
ISBN-139781801810692
Edition1st Edition
Languages
Right arrow
Authors (2):
Bryan Lyon
Bryan Lyon
author image
Bryan Lyon

Bryan Lyon is a developer for Faceswap.
Read more about Bryan Lyon

Matt Tora
Matt Tora
author image
Matt Tora

Matt Tora is a developer for Faceswap.
Read more about Matt Tora

View More author details
Right arrow

Exercises

  1. We use the mask to cut out the swapped face from the rest of the image but then copy it over to the aligned face. This means that the areas of the aligned image that aren’t the face also get a lower resolution. One way to fix this would be to apply the mask to the original image instead of the aligned image. To do this, you’ll need to call cv2.warpAffine separately for the mask and the aligned image, then use the mask to get just the face copied over. You may want to view the documentation for OpenCV’s warpAffine at https://docs.opencv.org/3.4/d4/d61/tutorial_warp_affine.html.

Be sure to account for the fact that OpenCV’s documentation is based on the C++ implementation, and things can be a bit different in the Python library. The tutorial pages have a Python button that lets you switch the tutorial to using the Python libraries.

  1. We rely on pre-extracted faces in order to convert. This is because a lot of the data is already...
lock icon
The rest of the page is locked
Previous PageNext Chapter
You have been reading a chapter from
Exploring Deepfakes
Published in: Mar 2023Publisher: PacktISBN-13: 9781801810692

Authors (2)

author image
Bryan Lyon

Bryan Lyon is a developer for Faceswap.
Read more about Bryan Lyon

author image
Matt Tora

Matt Tora is a developer for Faceswap.
Read more about Matt Tora