Page 1 of 1

Matching extraction "size" configuration with selected model type

Posted: Fri Sep 09, 2022 4:41 pm
by artisan

Per the extraction guide:

Size: This is the size of the image holding the extracted face. Generally 512px will be fine for most models. This is the size of the full head extracted image. When training a 'sub-crop' of this image will be used depending on the centering you have chosen. For 'face' centering, the image size available to the model will be 384px.

E.g. The Original model is noted as having input 64px, output 64px.

I understand this to be the portion of the extracted image fed to the model based on selected options for Face "Centering' and "Coverage."

[Newbie question] Does it make sense to extract to a size no more than the basic formula of:

Extraction Size = Model Input / Coverage (%)

Or, have I missed the relationship between the size of the extraction, the model input/output, and quality/efficiency of processing completely? :)


Re: Model Snapshots saved at same directory level as model directory?

Posted: Sat Sep 10, 2022 1:55 am
by artisan

Re: viewtopic.php?p=5888#p5888

I'm adding some info I found on the topic that is likely the best answer to my question:

The input resolution to the model is separate from the size of the extracted faces

Try not to think of the extracted faces as the training images, rather, they contain the training images. Whether you use Face or legacy centering, the actual images fed to the model will be a sub-crop from the extracted faces. Therefore, the extracted faces should always be of a higher resolution than the model input.

This gives a visualization of the sub-crops:
https://github.com/deepfakes/faceswap/pull/1095

Bear in mind that this is with 100% coverage. Sub-crop will shrink further with lower centering.


Re: Matching extraction "size" configuration with selected model type

Posted: Wed Sep 14, 2022 3:46 am
by MaxHunter

So, I was going to post I think the same question. Is it better to train @512px even if you're source face material is 64px? I'm understanding that it is fine (if not preferable.). Or, will that make the swap too grainy, like you cranked the sharp button up to 11?

Thoughts?


Re: Matching extraction "size" configuration with selected model type

Posted: Wed Sep 14, 2022 11:08 am
by torzdf

I'm not sure I fully understand the question. Training a model that is of a significantly higher resolution than any of your dataset is likely to not end with great results


Re: Matching extraction "size" configuration with selected model type

Posted: Wed Sep 14, 2022 11:27 am
by artisan

Is there any such thing as a variable input (face size) model?

I know some models have configurable input sizes. However, is there any model that would handle different sized inputs (without rescaling to a fixed input)?


Re: Matching extraction "size" configuration with selected model type

Posted: Wed Sep 14, 2022 8:56 pm
by MaxHunter
torzdf wrote: Wed Sep 14, 2022 11:08 am

I'm not sure I fully understand the question. Training a model that is of a significantly higher resolution than any of your dataset is likely to not end with great results

I think you answered my question.

To further explain:

I've recently chose to build a DNY512 model. Most of the faces I've been training with are not even close to 512px, there are a few but most are probably half that size or less.

If I were to use this DNY512 model on a video with a resolution of 480, will the faces be over sharp? Or, will the program detect this and downscale the face?


Re: Matching extraction "size" configuration with selected model type

Posted: Fri Sep 16, 2022 11:11 am
by torzdf

I highly doubt the image will be overly sharp. I wouldn't imagine anything detrimental would come from this approach, just that you wouldn't necessarily be using the model to its full capacity.