PTI icon indicating copy to clipboard operation
PTI copied to clipboard

[question] What kind of pre-processing would a model that doesn't generate faces require?

Open danpaldev opened this issue 1 year ago • 1 comments

Hi there!

I’ve been trying to invert some pictures using pre-trained models that don’t generate faces. For obvious reasons, I’ve been skipping most of the pre-processing, such as dlib face alignment, being the resizing the only part that I left.

However, both the final embedding and the fine-tuned model are of poor quality, either being distorted or blurred. It seems the repository is specifically designed for faces, so I was wondering if you could tell us any best practices or advice about pre-processing pictures that aren’t necessarily faces.

Thanks for the good work!

Regards

danpaldev avatar Jul 01 '23 02:07 danpaldev

Hi @danpaldev, It depends in the pretrained StyleGAN. Lets take StyleGAN-Human for example. You can see under the 'Aligned raw images' section the preprocessing functions they use prior of using the GAN. You will have to mimic the process for each pretrained GAN. The alignment of faces is different compared to other alignment methods.

Because many GANs use PTI as their main inversion scheme I would advise you to copy their code and use PTI as they use it

danielroich avatar Jul 04 '23 14:07 danielroich