Exploring Deepfakes by Bryan Lyon and Matt Tora

Exploring Deepfakes by Bryan Lyon and Matt Tora

Author:Bryan Lyon and Matt Tora
Language: eng
Format: epub
Publisher: Packt Publishing Pvt Ltd
Published: 2023-03-02T11:45:08+00:00


We use the desired_segments variable to define which of the masker segments we want to use. In our current masker, this gives us the face itself and discards background, hair, and clothing so that our model will only need to learn the information that we want to swap.

Lastly, we get a list of files in the input folder: alignment_data = {} list_of_images_in_dir = [ file for file in os.listdir(opt.path) if os.path.isfile(os.path.join(opt.path,file)) ]

This code first prepares an empty dictionary to store the alignment data. This dictionary will store all the data that we want to store and save with the face data we’ll use to convert with later.

Next, it will get a list of all files in the folder. This assumes that each file is an image that we want to import any faces from. If there are any non-image files, it will fail, so it’s important to keep extra files out of the folder.

Next, files in the directory are listed and checked to ensure they’re files before being stored in a list.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.