DeepFaceLab icon indicating copy to clipboard operation
DeepFaceLab copied to clipboard

Is it possible to train DeepFaceLab using multiple destination faces?

Open Adnan-annan opened this issue 3 years ago • 5 comments

I traiend my own model for face swaping. When i run it on deepfaceLive, it swaps the face perfectly with the same destination face, but the results are not good when any other face is presented to it as the destination. Does it mean i have to train my model again with multiple face destinations ? Is it possible ?

THIS IS NOT TECH SUPPORT FOR NEWBIE FAKERS POST ONLY ISSUES RELATED TO BUGS OR CODE

Expected behavior

Describe, in some detail, what you are trying to do and what the output is that you expect from the program.

Actual behavior

Describe, in some detail, what the program does instead. Be sure to include any error message or screenshots.

Steps to reproduce

Describe, in some detail, the steps you tried that resulted in the behavior described above.

Other relevant information

  • Command lined used (if not specified in steps to reproduce): main.py ...
  • Operating system and version: Windows, macOS, Linux
  • Python version: 3.5, 3.6.4, ... (if you are not using prebuilt windows binary)

Adnan-annan avatar Dec 09 '22 03:12 Adnan-annan

Yeah, unfortunately that's how this works. Not completely sure if you could train on two destinations at once, but training on one destination does not mean that you'll be able to port it to another destination.

NolanMangalMM avatar Dec 09 '22 08:12 NolanMangalMM

Yeah, unfortunately that's how this works. Not completely sure if you could train on two destinations at once, but training on one destination does not mean that you'll be able to port it to another destination.

@NolanMangalMM so what should i do ?? how to generalize it to any new face? just like they have provided examples in deepfaceLive where i can use any destination face and still able to do the faceswap of the examples provided..

Adnan-annan avatar Dec 09 '22 08:12 Adnan-annan

@Adnan-annan this isn't deep face live and you're gonna have to retrain your model. You might have success if you train the model on multiple destinations, but I honestly doubt it. If you try it though, let me know how the results are.

NolanMangalMM avatar Dec 09 '22 08:12 NolanMangalMM

@Adnan-annan this isn't deep face live and you're gonna have to retrain your model. You might have success if you train the model on multiple destinations, but I honestly doubt it. If you try it though, let me know how the results are.

@NolanMangalMM The main question is that how did they train thier models (which are provided in deepfaceLive to use as an example), which can take any destination face as input and swap it with the source face? What was the procedure to train such a generalized model ? did they use alot of different peoples faces in destination for training their example models?

Adnan-annan avatar Dec 09 '22 08:12 Adnan-annan

@Adnan-annan the solution for your question is in the next tutorial:

https://mrdeepfakes.com/forums/threads/guide-deepfacelab-2-0-guide.3886/

Follow steps of "10.4 RTM Training Workflow". Main idea is:

  1. Download data_dst from this repo: https://tinyurl.com/2p9cvt25 it contains a SFW dataset with multiple destination faces.
  2. Use generic WF RTM model as start point of your training (it speed up your model training). You can find pretrained models of every size, network,... in https://mrdeepfakes.com/forums/threads/sharing-dfl-2-0-saehd-models.3646/
  3. Follow steps that I mentioned before in tutorial.

It takes between 3 days and 1 week of training, usually with 0.3-0.4 loss on dst, you could have good results. After that, you will have a generic model for multiple destination files. I trained 3-4 models with this method and it works. Process is quite slow but results worth it.

Be careful on "mrdeepfakes" website, because it has a lot of useful tutorials for beginners but also has a lot of NSFW content on it and you could find unexpected things.

Suaro avatar Mar 25 '23 15:03 Suaro

Issue solved / already answered (or it seems like user error), please close it.

joolstorrentecalo avatar Jun 08 '23 23:06 joolstorrentecalo