This video is made possible by MSI.
For a long time, I've been editing at home on a laptop, and more specific the P65 from MSI,
which is great but it is still a laptop.
So when MSI reached out again, but this time for their brand-new desktop series, the P100, I was super excited.
So the first thing that I did was getting a new desk, a new chair,
and some nice lights to put together my home office.
Not only does the computer look gorgeous, but also it's internal hardware is insane.
It's specifically built for creative task but I will dive a bit deeper into that during the video.
Now what's also new is their prestige monitor, the PS341WU,
which is very color accurate and it's 5k resolution is perfect to edit 4k videos on a single monitor.
Hey, guys, Jordy here from Cinecom.net and welcome to a very exciting tutorial.
We've all heard about deepfake and what it can do.
In it's very basics, it's kind of an advanced faceswap but it doesn't stop there.
Now we've been working on a Christmas video which will come out next week
If it's already out, you can find a link to it in the description below
or you can click in the card up there.
Now we've put my face and Yannick's face onto Harry and Marv from Home Alone.
Now we've had tremendously great help from Chris, who is specialized in deepfake
and he has explained this detail how it all works
and some bonus tips which we can share with all of you guys.
Now Chris makes tons of amazing deepfakes and visual effects videos
so definitely check him out on YouTube or Instagram linked in the description below.
So let's get started with step #: you pick your favorite scene from the film or you shoot something yourself.
The idea now is to place your face, or that of someone else, usually a celebrity,
on to a person in the scene that you picked out.
If you go for a celebrity, try to gather as much face data as you can from that person.
You know, scrap through films, look on YouTube for interviews of that person, etc.
Important is that the video is high quality and that nothing comes in front of the face.
Ideally, you want to have a video of around 20 minutes
that contains as much facial expression from as many angles as possible.
When multiple actors appear on screen, use your editing software to cover up those faces.
The cleaner your source data is, the better the results will be.
Now if you're going to use your own face, like we're doing with Home Alone,
then you need to film yourself for about 20 minutes.
And since you already know where your face will come,
you can kind of try to make the same expressions as the actors do in the film.
And if you pay attention to the small details, like shaving your beard just as Marv from Home Alone,
the results will also be better.
So that's the reason why my beard looks like this, okay? It's not my choice.
So when you got your two video clips, it's time to install the deepfake software.
There are mainly 2 programs.
You got Faceswap and Deep Face Lab.
Now we're going to work with the second one but we'll leave links to both in the description.
You'll find different builds.
Just take the last one.
If you have an NVIDIA graphics card, download the CUDA build.
Otherwise download the OpenCL one, and install the exe file.
It will extract a folder with a bunch of files in there.
These are batch files and will run a certain command.
They are numbered from 1-10 which are the different steps to complete.
However, we don't need to run every batch file.
Starting off, open up 'Clear Workspace.'
For the first time, this won't be necessary but if you ran a deepfake process before,
you do need to do this to clean out the previous data.
Now when you open up the workspace folder, you'll find 2 clips in there.
Data_dst, which is the destination video, or the video where you're going to place the new face on.
And this here is the source, which is the face data clip.
Now these are 2 sample clips which you can use to try out the software.
But the idea is that you delete these clips, export your 2 videos into this folder, and give them the same name.
Next, simply go to the next step, which will extract the images from the source.
For the FPS, or frames per second, you can choose 7 or 8.
We don't need every single frame from the video as that will give too much data to the AI later on
which will extremely slow down the process without much better result.
When that is done, you'll find in the folder workspace 'data_src'
every frame of the video clip exported to a PNG image.
Ideally, you want to end up 5,000 images in here.
Now basically, you could also export out of Premiere Pro, or whatever, to an image sequence,
but if you do, also export to that framerate of around 7 or 8.
The next step is exactly the same but now for the destination video.
So click on 'Step 3.2.'
This will use the full FPS by default or else the final video will look choppy.
Hit 'Enter' and 'Enter' again.
Now we also see all the images extracted in the workspace 'data_dst' folder.
Alright, next up we're going to extract the faces from the image sequence.
Starting off with the source data, you'll find various methods to extract the faces in step 4.
We're going to choose extract 'faces S3FD best GPU.'
Now I'm not going to dive into every single detail with the differences are between all the methods
as I'd like to keep this tutorial short and to the point.
But I'll leave a link below to where it's written all out in detail if you would like to learn more about it.
So when that is done, we're going to do the same thing for the destination
and choose #5: data_dst extract faces S3FD best GPU.
Alright, all the faces have been extracted and can be found back in the workspace data_src aligned.
But the same goes for the mapped data destination,
What you want to do now is manually clean up the extracted faces.
Look for blurred faces, things that aren't the face, an upside down face, etc.
Try to only keep the cleanest faces which are going to give the best results.
Now if you're working with thousands of images in here, it could take a while,
so under step 4 and step 5, you'll find various commands to sort your destination images.
Alright, all of the preparations have been done.
We can now start with the training, or in other words, the artificial intelligence because that sounds way cooler.
Under step 6, we can find various training methods.
Now these use different techniques and, unfortunately, there isn't one which is the best.
It all depends.
Deepfaking is all about trial and error.
Now one of the differences is the need of computer resources, mostly video memory.
Now we're going to work with SAE which gives great results
but if you don't want to wait for weeks for the process to complete,
it is best that your computer has some good hardware.
So, maybe the MSI P100 is something for you.
It features a beast of a GPU, up to the NVIDIA RTX 2080Ti, which is perfect for such tasks.
Deepfaking uses a lot of video memory and this one has 11gb, which is a lot.
This card is also able to work with with 8k footage and is perfect for 3D tasks.
It's packed with the latest Intel i9 CPU and up to 64gb of memory.
They also have a software called 'Creator Center' which is actually very useful.
Now you can prioritize certain apps, like your editing software.
The system will then optimize the system for that chosen program.
But more information about all the specs so all you can click on the first link in the description below.
Oh, yeah, one more thing that you guys might be wondering is how the cooling system is
because nice design doesn't always mean good cooling.
Now I'm not a specialist on this but what I can say is that we had the computer running
the very intense deepfake software for more than 10 days straight.
The system was super stable and did not overheat.
So, yeah, it's awesome.
They call it the 'Silent Pro Cooling System' which basically comes down
to that the hottest components have their own airflow and separate chambers.
Alright, back to the deepfaking now.
Click on 'train SAE.'
You'll get a bunch of setting that you can change and tweak.
For most, we'll use the default setting except for a few.
Starting with 'Unable Auto-Backup,' choose Yes because SAE is not 100% stable.
Here's an example of SAE crashing.
If that happens, you can stop the deepfake learning, restore your backup, and start again.
Moving on to the 'Batch Size,' the larger this number is,
the faster the deepfake learning would go but your computer has to handle it as well.
Setting it too high will give you an error.
If that happens, don't worry; just start it again with a lower batch size.
Like I said before, deepfaking is all about trial and error.
And, finally, enable 'Gradient Clipping.'
Select Yes.
This will eliminate crashes and guarantees a more stable process.
And that's it!
The AI is now learning how your face works and how it can match that to the destination face.
Right here, you can find the iterations.
Ideally, you want to have at least 150,000 iterations to get a good result.
Basically, the longer you let the software run,
the better the AI can study your face and the better the results will be.
So, yeah, do expect your machine to run for several days now.
3 days later..
When you think it's done, simply press the Return key.
Alright, we're almost there, guys, we're getting to the end of the list.
Now all of the data has been generated.
Now we would like to put everything together.
And that is done with the 'Convert' command.
Pick the same convert method as the train method you've chosen previously and, in our case, that's SAE.
You'll again get a list of options, this time they are important,
however, we are going to change them afterwards.
So right now, just hit Return and take the default setting for every option.
When you get through the list, you'll see a shortkey map.
Pressing 'Tab' will show or hide the shortkeys but as you can see, we can now change the convert settings,
like the mask and skin colors and all, in real time which is much easier, again, through the command line.
When you're done just hit Return, and then hit Return again, then the converting will start.
Wait it out and, when it's done, you're done.
Now there's one final thing that we have to do
and that is converting everything into a new movie file which is step #8.
You can convert to a normal mp4 which you ideally want to do as the first step.
This is to see the final result and check if everything is okay.
Maybe you need to let the training run longer or capture more angles of your source clip.
You can always add new images into the data source folder and run the training again.
Also, the converting can be done again.
Keep in mind that once the training is done, that it's data is stored as a model
so you don't need to run that again to change some settings in the converting.
Now here's a bonus tip that most people don't do but it could make a very big difference.
Do a final convert to 'Lossless+Alpha.'
This will allow you to place the destination clip into a timeline of your favorite video editor
and the final result on top of there.
Because it's transparent, you can tweak the face further in there,
like using Lumetri to color correct it, changing or adding feather to the mask, and so on.
The options in here are endless.
So right here is the result of what we've just been working on with the comparison of what you get
straight out of the deepfake and when you tweak it some more using something like After Effects.
Whew, and that's it, guys, what a long tutorial.
That is how you can deepfake or at least a beginner's guide to it.
Again, it takes a lot of time to master and to get familiar with all the options and different methods.
VFXChris is a master at this and I definitely suggest to check out his work.
He does a lot of deepfaking and visual effects, again, linked in the description down below.
Thank you so much for watching.
Thank you MSI for the support.
And, as always, stay creative.
What happened?
I think it's filmed right.