MrDeepFakes Forums

Some content may not be available to Guests. Consider registering an account to enjoy unrestricted access to guides, support and tools

  • We are looking for community members who are intested in helping out. See our HELP WANTED post.

Deepfakes for images

aezaekiel

DF Vagrant
Hey there, first off thanks for all the wealth of info in this forum. I can't seem to find anything regarding these questions which might be answered somewhere but I haven't found anything yet. 

Anyhow, I was wondering if it makes sense to use DeepFakesLab to swap faces on a picture or if there's something better/quicker? 

To get decent results is it better to have lots of images of faces or better quality ones?

Thanks for any and all replies.
 

Pololo

DF Vagrant
Hello, sorry for the English, but I'm using the Google translator, yesterday I was testing a video and this at the beginning, had a cover with the photo of the model of the video, and changing the faces of the video also changed the frames of the photo, and it's great. As soon as I can I create an avi or mpeg from photoshop with 1 frame of the body of a model and I put the face of an actress with about 1000 frames of training, to see that it comes out, since supposedly if you do it directly from photoshop (retouching digital image) takes less, but the results are usually very crappy. It must be curious to see how the AI solves it.
 

Pololo

DF Vagrant
I'm doing it, but it's a very slow process, even if you do it with a photo, it will take the same "training". Theirs is to take many photos that you want to change the face and create a video with these photos, especially photos or all vertical, or all horizontal, not to screw the screen format, and then you put the faces, I'm testing with 12 photos and it will take 24 hours until 100,000 epoch, if I get to know I make a video with 100 photos to change their faces. I can not put the results because I'm using familiar faces, but for now the training is leaving very well, especially if they are pictures with the look to the front.
 

Pocketspeed

DF Admirer
Verified Video Creator
Generally, how deepfaking works is this:

We have 2 videos.  One is the video we want to put a face in.  The second video is the face we want to put into the other one. We first start by breaking each video into individual frames (or still photos, same thing). Then we detect and extract the faces from each video, and this is our "training data". After many hours (potentially 24+ hours) we use our model data to replace the face in all the frames from video 1. Finally, we convert our individual frames back to a video format.

So, yes, it is possible to use deepfaking tech to get one single picture with a swapped face.  Because essentially we are swapping faces on pictures anyway, just a large amount of them at a time.

That being said, here's a few points to consider:

1. You will still need a decent amount of training data. This means you will need hundreds, if not thousands, of face pictures.

2. Deepfaking technology still has trouble with partially obscured faces (hands and hair in front of the face, eyeglasses, etc.)

3. Training for a faceswap will take hours. Sometimes over 24 hours of continuous training. If you train with CPU, it will literally take weeks.

4. Deepfaking has very specific hardware and software requirements, so not all machines will work.

5.  I'm not sure if you can use just one photo in place of video 1.  I've never tried it.  My understanding is that you will need at least a number of photos equal to or greater than the batch size you will be using. You will still need hundreds of photos for your second dataset (video 2).

So while it is possible to get a single photo with a swapped face using deepfaking, the problem is that it's just not very efficient to do so. The extraction and conversion processes will be faster, yes, but training still takes several continuous hours. There is no way to predict how long it will take, you just have to look at the results of your training data and decide when it is ready. You still need a LOT of pictures of the faces, not just 1 or 2. You still need to meet specific hardware requirements.

The bottom line is this: due to the time involved, the amounts of data needed, and the hardware requirements, it's just going to be faster and more efficient to use Photoshop or another photo editor. If you want to spend an entire day or more to make one photo, then you certainly can do that. But in my opinion, that is a very inefficient use of time and resources. You could use Photoshop to make a convincing photo in 1/10th of the time.

And if you don't know Photoshop that well, and don't have the time to learn how to use it, well....you will discover that you will need to learn how to properly use a deepfake application too.  None of this is as simple as using a mobile app.  It takes time, and it takes practice.  Or if you can't afford Photoshop, then you can use GIMP, which is open-source, completely free, and can do 99% of everything that Photoshop can do.  There are hundreds of tutorials on Youtube and other sites for both Photoshop and GIMP.

Ultimately, how much time you want to spend to make a fake photo is your decision though.
 

Pololo

DF Vagrant
It's just worth it if in the video you put about 100 photos as a minimum or 1000 photos, the good thing is that the more photos you set, the better results you will get, because of the 12 that I have put, only 2 are being very realistic. Another thing that I have checked, the src photos are theirs is that they are real photos, not frames taken from a video, quality photos converted to PNG, gives many better results, what I do not know is the maximum resolution of the training program , I think 1080p, his thing would be to be able to do this from the photos at least 4k. Everything will come. Regards, and sorry for my bad English, I'm using "Google translator".

UPDATE:

After using SAE with LIAEF, with 102,000 trainings, 11 of the 12 photos have been impersonated perfectly, I was surprised by the result, all SAE options I left by default, it took about 12 hours, I have a 1080 ti.

I'm going to try again with H128, to see what results it gives me, I always try to find photos that look straight ahead, but I'm telling you, the ones that have created me now have gone perfect, even skin tones, eyes, etc. .

The next ones I will do with an actress, using pictures of quality, not frames taken from a video.
 

aezaekiel

DF Vagrant
Thanks for all the replies. I understand the whole photoshop thing but that means actively working on it while I'm getting decent results just by letting my machine do the work for me. I've understood the basics and I know the more experience you have in something the better you'll get it done, but this was always meant to be a low effort attempt and it's working suprisingly well.

I was curious to know if there was actually something focusing on swapping faces on images instead of videos and I guess the short answer is no. Long answer is, DFL can do it but it might not be as efficient as using photoshop and similar applications which for the non experts can be a bit daunting.
 

titan_rw

DF Pleb
I've tried picture fakes using DFL. It works, but the issue is resolution. Usually pictures have significantly higher res than video. Or put another way, lower resolution video's are more acceptable than low res pictures. Being that DFL is meant for video, there's a resolution limit to faces. This is acceptable for video where a fake at 1080p is about as high a res as you're going to make. Pictures commonly start at 2048x1500 or so, greater than 1080p res.

DFL will still do it's thing, and create the right resolution output file, but it's going to have to scale up the face to fit the resolution of the picture. The result will be a 'soft' face on a relatively 'sharp' picture. The only real way to 'fix' that is to downscale the entire picture to fit the effective res of the face.

So you'll end up with a fairly low res picture fake. The advantage is that you can do 1,000's at once without it taking 1000x as long as one. 1000's of relevantly low res fakes are kinda exactly what a video is.
 

Pololo

DF Vagrant
I've tried it again today, it's much easier than it was before, which created a video with the photos inside. I directly convert jpg photos into png, and then I give the option to extract faces directly, from those photos converted to png. You can put 10,000 photos in png, of totally different themes, and it will extract the faces, and then you merge them perfectly with the training. Some are perfect and others are horrible, but from 10,000 photos comes a very high percentage of perfect faces.
 

plover78

DF Vagrant
Basically, as I understand it... It makes sense to save some "deep fake images" by extracting some frames of a deep fake video you've created... However, it doesn't make sense to spend so much time training to simply get a fake image. In that case, Photoshop or GIMP are likely better options, but yes requires active work...
 
Top