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?

Technical requirements

For this chapter, there is one section with a small amount of code that demonstrates how to use a non-module Git repo for your own uses.

While this isn’t part of the hands-on section of the book, we’ve included the code to interface with a library: PeCLR. This code is also included in the book’s code repo with some additional functionality, including visualizing the points, but is just an example and is not meant to be a complete API for using PeCLR in your own project:

  1. First, open Anaconda Command Prompt.
  2. On Windows, hit Start and then type anaconda. This should bring up the following option:
Figure 8.1 – Anaconda Prompt

Figure 8.1 – Anaconda Prompt

Click on this, and it will open an Anaconda prompt for the rest of the following commands.

  1. Next, we need to clone a copy of the PeCLR library:
    git clone https://github.com/dahiyaaneesh/peclr.git
  2. Download the model data.

The library includes a copy...