faceswap icon indicating copy to clipboard operation
faceswap copied to clipboard

Recent git pull includes Gan support but no relevant documentation.

Open fetchlister opened this issue 8 years ago • 11 comments

I am trying to use GAN support in my faceswaps as my previous attempt of 3 days of training yeilded terrible results with 3k pictures (a good blend) for each target. I see that the python scripts are there but running them produces no output and USAGE.md has not been updated to reflect the extracting, training, and converting process for use with the GAN plugin.

Using a GPU on linux with python version 3.6.4 Latest available Faceswap.

fetchlister avatar Feb 10 '18 06:02 fetchlister

For the training process just add: -t GAN

For converting add: -t GAN -c GAN

Uklosk avatar Feb 10 '18 08:02 Uklosk

@LordVulkan does GAN require any new dependencies? And does this eliminate the option of live preview? (-p no longer works)

fetchlister avatar Feb 10 '18 09:02 fetchlister

No new dependencies and the preview works for me.

What output log are you getting?

Uklosk avatar Feb 10 '18 09:02 Uklosk

Neverming. I had to add bs=32. Din't hit me that the loss of preview was related to the out of memory error.

so just to clarify, add -t GAN when training and then -t GAN -c GAN when applying trained model to a directory of frames of say, a video to replace the faces?

fetchlister avatar Feb 10 '18 13:02 fetchlister

Yes.

-t is from trainer and -c is from converter.

Uklosk avatar Feb 10 '18 13:02 Uklosk

Is there an established threshold for loss numbers with the GAN plugin yet? I'm getting two sets of numbers now instead of just one. usually people say stop around 0.09, should I ignore the Loss_GB value or what?

fetchlister avatar Feb 10 '18 13:02 fetchlister

I don't know much about GAN, but if I'm not wrong it uses two models, a generator and a discriminator.

Loss_GX should be the value for the generator and Loss_DX for the discriminator.

I don't know what values should be considered acceptable as the discriminator values are constantly jumping, and during my tests the generator values are stuck at around 0.17 after ~15 hours.

Uklosk avatar Feb 10 '18 14:02 Uklosk

What GAN really does? Improving quality?

shadowzoom avatar Feb 10 '18 18:02 shadowzoom

It's a different algorithm, I'm not sure it produces better results by default, it needs more resources.

More info: https://github.com/shaoanlu/faceswap-GAN

Uklosk avatar Feb 10 '18 22:02 Uklosk

Feel free to discuss about this in https://github.com/deepfakes/faceswap-playground and/or make a Pull Request to improve documentation

Clorr avatar Feb 11 '18 16:02 Clorr