danielroich / PTI

Official Implementation for "Pivotal Tuning for Latent-based editing of Real Images" (ACM TOG 2022) https://arxiv.org/abs/2106.05744

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

danpaldev opened this issue · comments

commented

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

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