Book Image

Exploring Deepfakes

By : Bryan Lyon, Matt Tora
Book Image

Exploring Deepfakes

By: Bryan Lyon, Matt Tora

Overview of this book

Applying Deepfakes will allow you to tackle a wide range of scenarios creatively. Learning from experienced authors will help you to intuitively understand what is going on inside the model. You’ll learn what deepfakes are and what makes them different from other machine learning techniques, and understand the entire process from beginning to end, from finding faces to preparing them, training the model, and performing the final swap. We’ll discuss various uses for face replacement before we begin building our own pipeline. Spending some extra time thinking about how you collect your input data can make a huge difference to the quality of the final video. We look at the importance of this data and guide you with simple concepts to understand what your data needs to really be successful. No discussion of deepfakes can avoid discussing the controversial, unethical uses for which the technology initially became known. We’ll go over some potential issues, and talk about the value that deepfakes can bring to a variety of educational and artistic use cases, from video game avatars to filmmaking. By the end of the book, you’ll understand what deepfakes are, how they work at a fundamental level, and how to apply those techniques to your own needs.
Table of Contents (15 chapters)
1
Part 1: Understanding Deepfakes
6
Part 2: Getting Hands-On with the Deepfake Process
10
Part 3: Where to Now?

Summary

Extraction is the first step of the training process. In this chapter, we examined the data that we will need in later steps as well as the process of extracting the required training data from the source images. We went hands-on with the process, using multiple AIs to detect and landmark faces and generate a mask, as well as the necessary steps to process and save that data.

The C5-face_detection.py file can process a directory of images. So, we covered how to convert a video into a directory of images and how to process that directory through the script. The script creates all the files you need for training and some interesting debug images that let you visualize each of the processes the detector uses to process the images. We then looked at the entire process, line by line, so that we knew exactly what was going on inside that script, learning not just what was being output, but exactly how that output was created.

After finishing the detection process, you can go...