Preparing to convert video
Conversion is not just a “one-and-done” script. It requires you to have turned a video into a series of frames and run C5-face_detection.py
on those frames. This gets the data that you need for the conversion process in the right form. The conversion process will require the full extraction of every frame, as well as the face_alignments.json
file that is generated by the extract process:
Figure 7.1 – Example of a folder that has been extracted already. Note the face_images folder created by the extract process
If you haven’t done the extract process on the video you want to convert, then you should go back to Chapter 5, Extracting Faces, and extract the video.
We need to do this because this is how the model knows which faces to convert. AI can detect all faces in a frame but won’t know which ones should be swapped, meaning that all faces will be swapped. By running the extract process and...