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 used pre-existing libraries for face detection, landmarking, and aligning landmarks. There are other libraries that offer similar functionality. Not all libraries work the same way, and implementing the differences is an extremely useful exercise. Try replacing the face_alignment library with another library for detecting faces, such as https://github.com/timesler/facenet-pytorch or https://github.com/serengil/deepface. Open source has lots of useful libraries but learning the differences and when to use one over another can be difficult, and converting between them can be a useful practice.
  2. We used 2D landmarks for alignment in this chapter, but there may be a need for 3D landmarks instead. Try replacing the following:
    face_aligner = FaceAlignment(LandmarksType._2D,
      device=device, verbose=False)

with:

face_aligner = FaceAlignment(LandmarksType._3D,
  device=device, verbose=False)

and adjust the rest of the process accordingly...

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