danielroich / PTI

Official Implementation for "Pivotal Tuning for Latent-based editing of Real Images" (ACM TOG 2022) https://arxiv.org/abs/2106.05744
MIT License
897 stars 112 forks source link

Custom Images - Run on full images #50

Open tanisha605 opened 1 year ago

tanisha605 commented 1 year ago

When trying to run model on a full image, it gives only the face part. How can I run the model for full images

danielroich commented 1 year ago

Hi @tanisha605, You will have to use a specific GAN for this action. For example StyleGAN-XL or StyleGAN-Human. The facial pretrained GAN assumes the facial image is aligned and only looks at the face.

Of course you could always incorporate the edited facial image to the original image as they do in STIT

631068264 commented 1 year ago

@danielroich Can you give some code example how to change the GAN model?

Or just replace this in https://github.com/danielroich/PTI/blob/main/notebooks/inference_playground.ipynb

image
Vadim2S commented 1 year ago

It is more complicated. "Full" (human body) image required usage of StyleGAN_Human model what has proportion 2:1 instead 1:1 of face FFHQ model. Moreover StyleGAN_Human has num_ws=16 instead FFHQ num_ws=18. Sadly modification direction (age, smile, rotation) also has dimension of 18. Summary: this (original) PTI project do not support full body human image inversion and modification. For inversion use PTI fork from StyleGAN_Human project. For modification... i am do not know. I am want advice myself.