faceswap icon indicating copy to clipboard operation
faceswap copied to clipboard

Can I use this app to swap faces other than Nicolas Cage?

Open carldgosselin opened this issue 8 years ago • 5 comments

Can I use this app to swap faces other than Nicolas Cage? I tried to replace the pics in the input_A folder to another actor but it didn't work. Does this only work on Nicolas Cage's pics?

carldgosselin avatar Feb 19 '18 18:02 carldgosselin

That's the magical thing about Nicolas Cage. His face is the only face computers can understand. We strongly suspect he is a perfect being from a future timeline where machines have taken over.

In all seriousness, there's more steps than just replacing the pictures. Did you do the extract and train steps from the readme?

rifterbater avatar Feb 19 '18 21:02 rifterbater

I'm starting to believe that he is from the future, and maybe from another planet. This is the only way I can explain my previous results.

But seriously, I actually did extract and train two different sets of pictures/people but nothing really happened during the convert stage - it only partially blurred the face in the target pictures. Clearly not as good of a result as Nicolas Cage's pics. I'll have to try again.

Here are the high-level steps I followed (maybe there is a glaring mistake in my flow): step 1. I took a series of pictures from Actor1 and placed it in a folder called "input". Pictures were derived from a video using ffmpeg. step 2. I ran python faceswap.py extract step 3. result: the face pics were created in the "output" folder. I copied and pasted the pics into "input_A" folder step 4. I cleared the "input" folder. Also cleared the "output" folder. step 5. I repeated the process for Actor2 and placed the face pics from "output" to "input_B" folder step 6. I then ran python faceswap.py train step 7. I cleared the "output" folder for the next step. I made sure the pics I wanted altered were in the "input" folder with the alignments.json file included. step 8 Finally, I ran python faceswap.py convert. Unfortunately, the faceswap didn't seem to work, it only partially blurred the original faces.

Does anyone see any major flaws in the above steps or should I just keep trying?

Thanks in advance for your help. I already appreciate the initial response as I know that this solution should work on other people/faces.

carldgosselin avatar Feb 20 '18 00:02 carldgosselin

how much time has passed between Step 6 and Step 7? The network will work better the longer you train, we're looking at losses < 0.01 for decent looking results. Otherwise you'll just get blurry images as the network is in the process of "learning" the encoder/decoder relationship :+1:

andykdy avatar Feb 20 '18 01:02 andykdy

Just an aside - @carldgosselin make sure you are putting the right faces in -A and -B. I made that mistake once or twice and took me awhile to figure out why the faces looked horrible.

fetchlister avatar Feb 20 '18 01:02 fetchlister

Thanks for your comments everyone. I think I need to train the network a little longer and make sure I have good quality pictures.

carldgosselin avatar Feb 20 '18 13:02 carldgosselin