Ads Area

Creating DeepFakes Part1:- First Order Motion Model for Image Animation

Hello Guys, Welcome back to today's blog. As you might have seen up the title you must be well aware of today's topic. In which we are going to talk about DeepFakes. I will be telling you what it is, and the processes to build them. Let me tell you this is the Part 1 tutorial, in which I will be talking about the "First Order Motion Model for Image Animation" process in brief to create DeepFakes.


Deepfakes



So let's start without any further ado...

What are Deepkfakes?

So Guys, if we talk about Deepfakes, sometimes you all have encountered videos that sent you illusions. Yes, it feels like the person in the video is not the intended person means in a person in an existing image or video is replaced with someone else's likeness.

It works based on a Deep Learning algorithm/Process that captures the behavior of both identities(here referring to different persons) and then it tries to find the perfect fit to make the video look synchronized.

Types of Deepfake algorithms?

According to my research, I found two algorithms through which * Deepfakes * are created:-

  First Order Motion Model for Image Animation
  DeepFaceLab Framework( Face Swapping Technique)

In Part 1 of this Blog, we will be seeing up the first method in detail and will be setting up the whole thing.

STEPS FOR CREATION:-

* Guys remember here I will be showing you two ways to perform DeepFake generation * 


For the first One, we have a source image and a driving video. The identity(person) in the image is made to do the act performed in the video. I will be showing you the GitHub repository from where you can download the code and start creating DeepFakes.

STEP1:- Click on the link given -> GitHub repo. After that Click on the * code * named portion and Download the code in zip format.


Download DeepFake Repo in zip format.

STEP2:- Unzip the code and open it in any code editor( for eg. VS Code). 

STEP3:- We also need to have * python3 * installed.( Stable version:- Python 3.7)

STEP4:- After that, we will install (requirements for this project to work)

Use Command:-

pip install -r requirements.txt

Note:- Suppose you encounter any error while installing the requirements, like the outdated version of any particular module, in that case, change the version with the latest stable one by editing the requirements.txt file. 


STEP5:- Next you need to have a pre-trained Checkpoint or I should say a pre-trained model[ to make your DeepFake model work properly ].

You can download the checkpoint(of your choice let's say * vox-cpk.pth.tar * via this Google Drive Link provided. 

https://drive.google.com/open?id=1PyQJmkdCsAkOYwUyaj_l-l0as-iLDgeH
For this algorithm to work basically, we have an image and a video( The identity(person) in the image is made to do the act performed in the video).

You can search on the internet for the availability of both of these( you will find many) or you can also create one of your own.

Note:- The quality of the DeepFake created might be somewhat less because here we have a single image and we have to fit all the frames( in the video) with that single image object. 

STEP6: The last step you need to perform is to run the following command to create the DeepFake

Use Command:-


python demo.py  --config config/dataset_name.yaml --driving_video path/to/driving --source_image path/to/source --checkpoint path/to/checkpoint --relative --adapt_scale --cpu

  Change the following values accordingly(marked with yellow color):-

dataset_name.yaml (Try to study about them more)- Any dataset_name(the same one for which you downloaded the respective Checkpoint( FOR eg. vox-256.yaml acc to the Checkpoint downloaded). 

path/to/driving - Path to your Driving Video as suggested above.

path/to/source  - Path to the source image.

path/to/checkpoint - Path to the checkpoint Downloaded.

Remember to add --CPU at last of the command because we are using up our CPU to perform the operation.

If everything goes fine, your deepfake becomes ready after some time.


PROCESS2:-

The next process is via the online environment 

STEP1:- Open up the link given ->  Colab Link

STEP2:- After that the first step to take is to copy it locally on our Google Cloud Storage.  

Click on File -> Save a copy in Drive

STEP3:- After that run the first cell to download the Checkpoint.

STEP4: The next step depends on you, whether you want to use your own data(image and video) or the one provided.

STEP5:- For provided by them, you can select from the dropdown and choose the data amongst the selections provided.  

STEP6:- Or you can go to the portion of the files on the left and upload your own image and video. 

files section
STEP7:- Finally provide the respective paths to the source image and driving video and run the third cell to create the deepfake for you. 

Example DeepFake created by me:- 





So, guys, I told you much for this blog. If you want the second part(Second Technique) as well, tell me in the comments section or for the CyberSec Blog for identifying Deepfakes.
I would love to make a Blog over it.


Disclaimer: Responsible Use of Deepfake Technology


This blog content is intended for educational and informational purposes only. It aims to provide insights into the development and workings of deepfake models for academic, research, and ethical purposes. The information presented here should not be utilized for any malicious, deceptive, or unlawful activities.

The creation, distribution, or utilization of deepfake technology to deceive, manipulate, or harm individuals, groups, or entities is strictly prohibited and unlawful. The responsibility for the ethical and lawful use of any knowledge gained from this content solely rests with the user.

Users are encouraged to approach the understanding and application of deepfake technology with ethical considerations and a strong sense of responsibility. Any misuse or unlawful application of the information provided in this blog is explicitly disclaimed and is not endorsed or supported by the author(s) or contributors of this content.

By accessing this content, users acknowledge that they have read and understood this disclaimer, and they agree to use the knowledge gained responsibly and in compliance with legal and ethical standards.

If you like the content you can follow me up, can also subscribe to my [[YouTube channel]]. If you guys want me to keep bringing this sort of Blog and videos for you, you can show your support to me.


Buy me a coffee and show your Support 😊 ----- PayPal ID - https://www.paypal.me/agthecoder UPI ID- apoorvgupta@kotak




Post a Comment

2 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.