Swapping face on image only... no luck.

Converting source frames into swapped frames
Forum rules
Read the FAQs and search the forum before posting a new topic.

Please mark any answers that fixed your problems so others can find the solutions.
Post Reply
User avatar
sergor
Posts: 11
Joined: Wed Jan 15, 2020 7:59 pm
Has thanked: 8 times

Swapping face on image only... no luck.

Post by sergor » Wed Jan 22, 2020 12:48 am

First off - you devs are nothing but brilliant - this program motivates to go beyond what it does - this coming from a man who first rejoiced when the 8" floppy was reduced to 5,25" (yes I'm that old!)

I have been searching for a while for this topic and couldn't find one:

Starting slow I have gone through every process from extracting to sorting - torzdf needs cudos for documention - second I thought I read on a post (can't find it now..grr) that to simply swap faces in an image - no training was required for the convert. So to follow the process - do I make 2 libraries with single image (A->B) and the use the Alignment from the (Extracted, Sorted and Aligned) Faces folder?

I understand the process for videos just not when handling single images.And if the reply is "SAME PROCESS" - then I'm doing something very wrong.

If you already have this as an answer/solution posted - then apologies to any mod reading!

sergor
"Old - but not obsolete"

User avatar
torzdf
Posts: 554
Joined: Fri Jul 12, 2019 12:53 am
Answers: 86
Has thanked: 17 times
Been thanked: 121 times

Re: Swapping face on image only... no luck.

Post by torzdf » Fri Jan 24, 2020 11:47 am

I'm not entirely clear on what you're trying to do.

Ultimately, to swap faces (be it a single image or a video) then you need a trained model.

To have a trained model you need many many faces for both A and B to train on... so yes, unfortunately, the process is still the same.
My word is final

User avatar
sergor
Posts: 11
Joined: Wed Jan 15, 2020 7:59 pm
Has thanked: 8 times

Re: Swapping face on image only... no luck.

Post by sergor » Fri Jan 24, 2020 1:15 pm

@torzdf Was trying to figure out how to replace face in an image.

You train two different models - how does that allow you changing one face in one image? (I only understand how that would work for video sequences)

I'll keep at it, I may find the answer.

Cheers.

User avatar
Brigant
Posts: 2
Joined: Tue Apr 07, 2020 9:35 pm

Re: Swapping face on image only... no luck.

Post by Brigant » Tue Apr 07, 2020 9:40 pm

Have you figured it out yet?

I have the same problem. I do not want to convert videos. But swap out faces on images. I have no alignment files due to this, although I have trained models.

Without an alignment file, which I understand you get from scanning the video you cannot faceswap...I just try to figure it out also

User avatar
Brigant
Posts: 2
Joined: Tue Apr 07, 2020 9:35 pm

Re: Swapping face on image only... no luck.

Post by Brigant » Tue Apr 07, 2020 9:50 pm

Got the solution:

Even if you don't use videos and only work with images, the alignment file is generated in the various directories that you extract your faces from. There they were sitting all along and with them it worked just fine.

User avatar
sergor
Posts: 11
Joined: Wed Jan 15, 2020 7:59 pm
Has thanked: 8 times

Re: Swapping face on image only... no luck.

Post by sergor » Wed Apr 08, 2020 7:04 pm

Brigant wrote:
Tue Apr 07, 2020 9:50 pm
Got the solution:

Even if you don't use videos and only work with images, the alignment file is generated in the various directories that you extract your faces from. There they were sitting all along and with them it worked just fine.
Well - first I did what @torzdf told me to do - so with 20400 pictures I'm now training a model which currently is at 198000 iterations - from 17500 till now it's not really dropping in learning rate - still at 0.3800 at both folders (which suggests I've done something wrong or it hasn't "viewed" all faces enough times).

So at present I haven't tried changing a face in an image/video yet. Still tweaking the system. Installed a freeware program called cpuid - as I found out that batchsize was "killing" my system due to heat. So from 64 I turned it to 44 - system is stabile. A bit winded answer - but since starting I find the proverbial "bug" - within my own system.

And the program is so massive as to what it can actually do - that it's like looking a someone with a flight simulator and then shouting "I CAN FLY THE PLANE".

Oh one thing I can give you as tip - DO NOT DELETE alignment-backups - MERGE them!! I've had a few errors with "faces were found that doesn't exist in the alignments file. Nothing worked - until I merged the files (under Tools - Alignments - Merge)

Hope this can help
/sergor

User avatar
tweek_craigh
Posts: 3
Joined: Wed Apr 29, 2020 7:07 am
Been thanked: 1 time

Re: Swapping face on image only... no luck.

Post by tweek_craigh » Wed Apr 29, 2020 7:11 am

Hello,

This is thread is not that old and the subject is similar to mine i didn't want to create a new one (if it's considered hijacking please tell me so and i will create a new post).

So. I have two sources, trained a model exactly like the op. (I just want to swap faces on images to try DF).

My problem comes from Convert.
- Input dir is set as the Sources Images.
- Output dir is set as a new folder to get the result inside
- Model dir is the trained model
- Alignment file is the one in the extract folder of the source image.

Now i let everything on default and clicked on "Convert".

I have no errors, it says "complete" but the output dir is completly empty. Any clue ?

(Again apoligies if i should have made a new thread)

User avatar
torzdf
Posts: 554
Joined: Fri Jul 12, 2019 12:53 am
Answers: 86
Has thanked: 17 times
Been thanked: 121 times

Re: Swapping face on image only... no luck.

Post by torzdf » Wed Apr 29, 2020 9:00 am

No. I would need to see a TRACE log to see the issue (enable it with loglevel). NB: It will slow the process down and generate a very large file.
My word is final

User avatar
tweek_craigh
Posts: 3
Joined: Wed Apr 29, 2020 7:07 am
Been thanked: 1 time

Re: Swapping face on image only... no luck.

Post by tweek_craigh » Wed Apr 29, 2020 10:15 am

I do not know how to upload in this forum so here is a direct link.

https://lastterritory.com/text_file/log_test1.log

User avatar
torzdf
Posts: 554
Joined: Fri Jul 12, 2019 12:53 am
Answers: 86
Has thanked: 17 times
Been thanked: 121 times

Re: Swapping face on image only... no luck.

Post by torzdf » Wed Apr 29, 2020 10:22 am

The input folder D:\Testing\faceswap\Extract\Source\source_test1 only has 2 files in it, none of which are images. It only contains the alignments.fsa file and another folder called "source_test1"
My word is final

User avatar
tweek_craigh
Posts: 3
Joined: Wed Apr 29, 2020 7:07 am
Been thanked: 1 time

Re: Swapping face on image only... no luck.

Post by tweek_craigh » Wed Apr 29, 2020 10:55 am

Oh... There was a seconde source_test1 folder inside of it and when using browse it was stopping at the other :(

Thank you :)

User avatar
sergor
Posts: 11
Joined: Wed Jan 15, 2020 7:59 pm
Has thanked: 8 times

Re: Swapping face on image only... no luck.

Post by sergor » Wed Apr 29, 2020 1:20 pm

tweek_craigh wrote:
Wed Apr 29, 2020 7:11 am
Hello,

This is thread is not that old and the subject is similar to mine i didn't want to create a new one (if it's considered hijacking please tell me so and i will create a new post).

So. I have two sources, trained a model exactly like the op. (I just want to swap faces on images to try DF).

My problem comes from Convert.
- Input dir is set as the Sources Images.
- Output dir is set as a new folder to get the result inside
- Model dir is the trained model
- Alignment file is the one in the extract folder of the source image.

Now i let everything on default and clicked on "Convert".

I have no errors, it says "complete" but the output dir is completly empty. Any clue ?

(Again apoligies if i should have made a new thread)
Hey there, I had the exact same problem today - so you also solved my issue by asking on this thread - I only think the DEVS (moderators) take issue if a topic is non-sensical ie. requests for anything other than FS questions. For me it was during convert - 95% of my time has been with data-sets and extraction, alignment-cleanup so I struggled with input/output-paths when I finally tried my first convert.

So thanks :))

Have a good one
/sergor

Post Reply