Extraction Analysis Tool (for optimal output size based on source videos)

Want to know about the Faceswap's Face Extraction process? Got tips, ideas or just want to learn about how it all works? Then this is the place for you


Forum rules

Read the FAQs and search the forum before posting a new topic.

This forum is for discussing tips and understanding the process involved for Extracting and preparing face sets for training a model in Faceswap.

If you have found a bug are having issues with the Extraction process not working, then you should post in the Extract Support forum.

Please mark any answers that fixed your problems so others can find the solutions.

Locked
User avatar
artisan
Posts: 14
Joined: Sat Feb 12, 2022 1:22 am
Has thanked: 9 times
Been thanked: 2 times

Extraction Analysis Tool (for optimal output size based on source videos)

Post by artisan »

The resolution of the source video matters, of course. However, where the subject (beholder of a human face) is positioned within the video frame determines the actual resolution of the face image extracted, prior to saving at the specified output size. Movie clips with high quality close ups will offer the largest dimensions on extracted face images without scaling up and losing detail.

I'm curious to see if the experienced swappers would see any value in a tool that would basically run the extraction process (minus the file output) and give a summary of the sizes of detected faces.

They could be basic stats in bins like:

0 to 64 kb
64 kb to 128 kb
128 kb to 256 kb
256 kb to 512 kb
512 kb to 1024 kb

Giving us x-% of detected face images in each bin. Informing which input sizes would otherwise tend to sacrifice quality when inflating them to a different input size. It could basically tell more novice users that they either need better source video, or should choose training models that work with input resolutions more befitting the extracted faces they're working with.

Alternatively, rather than building a tool, it might simply summarize the above data in the command line output when the extraction is complete.

Any value to doing this?

User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 622 times

Re: Extraction Analysis Tool (for optimal output size based on source videos)

Post by torzdf »

Sure, you can go for it. I find having "larger" faces can help. You could probably work this into the sort tool though, which already has the ability to sort by size. The sort tool will be updated in the next couple of days, so you may want to wait, as the update will probably make your job easier.

My word is final

User avatar
artisan
Posts: 14
Joined: Sat Feb 12, 2022 1:22 am
Has thanked: 9 times
Been thanked: 2 times

Re: Extraction Analysis Tool (for optimal output size based on source videos)

Post by artisan »

I don't see the option to output detected faces at whatever size is detected (non-uniform output).

But I suppose running extraction multiple times with a high size setting, and changing minimum size from high to low to count how many are output each time. Not every elegant. ;)

User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 622 times

Re: Extraction Analysis Tool (for optimal output size based on source videos)

Post by torzdf »

Have a look at the updated sort options. You can group by "size" which will bin all of the faces in a set into labelled bins based on original face size.

My word is final

User avatar
artisan
Posts: 14
Joined: Sat Feb 12, 2022 1:22 am
Has thanked: 9 times
Been thanked: 2 times

Re: Extraction Analysis Tool (for optimal output size based on source videos)

Post by artisan »

Very cool. Definitely helps understand the distribution of original face sizes! I didn't even realize that the original face size data was maintained once extracting to a specific size.

Locked