Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Exploring Deepfakes

You're reading from  Exploring Deepfakes

Product type Book
Published in Mar 2023
Publisher Packt
ISBN-13 9781801810692
Pages 192 pages
Edition 1st Edition
Languages
Authors (2):
Bryan Lyon Bryan Lyon
Profile icon Bryan Lyon
Matt Tora Matt Tora
Profile icon Matt Tora
View More author details

Table of Contents (15) Chapters

Preface Part 1: Understanding Deepfakes
Chapter 1: Surveying Deepfakes Chapter 2: Examining Deepfake Ethics and Dangers Chapter 3: Acquiring and Processing Data Chapter 4: The Deepfake Workflow Part 2: Getting Hands-On with the Deepfake Process
Chapter 5: Extracting Faces Chapter 6: Training a Deepfake Model Chapter 7: Swapping the Face Back into the Video Part 3: Where to Now?
Chapter 8: Applying the Lessons of Deepfakes Chapter 9: The Future of Generative AI Index Other Books You May Enjoy

Running extract on frame images

To run the extract process on a video, you can run the extract program from the cloned git repository folder. To do this, simply run the following in an Anaconda prompt:

cd {Folder of the downloaded git repo}\
python C5-face_detection.py {Folder of frame images}

This will run the face extraction process on each of the images in the folder and put the extracted images into the face_images folder, which (by default) will be inside the folder of frame images. This folder will contain three types of files for each face detected, along with a file containing all alignments.

face_alignments.json

There will just be one of these files. It is a JSON-formatted file containing the landmark positions and warp matrix for every face found in the images. This file is human-readable like any JSON file and can be read or edited (though it’s probably not something that you’d do manually).

face_landmarks_{filename}_{face number}.png

This...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}