The first-order Motion Model is the model which involves the deep fakes. Deep-Fakes work on deep learning and involves training generative adversarial neural network architecture.
In this blog let's be precise on two things in a broaden way:
What are Adversarial Neural networks -- To understand the working of the code.
Understanding the depth knowledge of the code.
Let's Proceed with our 1st point:
Adversarial Neural Networks:
Adversarial Neural network or GAN (Generative Adversarial neural network) is one of the kinds of neural network which are used to approach a Generative Modeling using deep learning methods, Like CNN.
let's not dig deep in GANs rather we should start with the mere introduction of neural networks
As we all know neural networks are inspired by the neurons of the brain as we know them as nodes, there are many neurons that work to transfer information from the brain to different parts of the body.
for a more and deep understanding of Neural networks and related terminologies, we strongly recommend you to read this blog(MACHINE LEARNING and DEEP LEARNING)
So now you have a small understanding of the topic without wasting more time let's get back to our main part i.e. HOW TO WORK WITH DEEP-FAKES.
DEEP_FAKES And FIRST_ORDER_MOTION_MODEL:
ABOUT THE MODEL:
This model was trained by Sir Aliaksandr Siarohin, Stéphane Lathuilière, Sergey Tulyakov, Elisa Ricci and Nicu Sebe.
This model can swap the faces of the person with other faces, to understand it in simple words just see the below image.
As the above image we can see that the face has been swapped with some other woman who is pretending to give the same expressions.
Let's just Understand the Code now :
To start with the code we need to accomplish the requirements before starting to train the model.
Requirements:
You can run the code in your CPU, ie in your favorite IDE (we prefer to use JUPYTER)
You need to install python in your PC.(Assuming that you know how to use python we aren't going deep into it.)
Google colab is the best option if you want to get the output directly without coding (usually best for non-tech creators).
Step 1: First we need to install dependencies of the code for that we are going to clone the project from the Github repo. in order to do this run the following code.
Step 2: Now as we have cloned the Github repo we need to change the directory in order to run the model.
Step 3: Now you have successfully deployed the model, here we go to our input version, In order to give input to the code, we need to mount the folder from our google drive.
After running the above code, you have to click on the URL obtained that will take you to your google drive, and then you will see an activation code that you need to copy-paste in your python script or running cell.
see the image below:
Now the code will read the input only when your google drive has the required folder and images so make sure you will add the below folder in your google drive.
Add folder https://drive.google.com/drive/folders/1kZ1gCnpfU0BnpdU47pLM_TQ6RypDDqgw?usp=sharing to your google drive.
Step 4: Now Moving further we need to give input in our code, here we have to give input for the source image and driving video.
after running this cell you can see that the image you selected gets converted into video.
Step 5: Now the last step is that we need to perform animations, to do that just write the below code, it will give you the output of the image and video you had given in the above step and will create a beautiful deep face animation
The above code will change the face of the video you give as an input to the image in the face.
So this is how the First-order Model or deep fakes works to create ai content.
It can be dangerous as many of the creators or hackers use this tool to create misunderstanding in society and that too on a large scale.
There are many advantages as well as disadvantages using these models, But the amazing thing is you can use your own deepfake to do something aspiring and great.
DO FOLLOW OUR PAGE artificialgen.co , and if you are a content writer or content creator reach up to us through the various social media platforms.
ALL THE BEST!
Comments