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

The input parameters of the Generator #42

Open linziqu opened 1 year ago

linziqu commented 1 year ago

Hi, thanks for your great work!

I am curious about all the input parameters such as 'noise_mode', 'force_fp' of self.G.synthesis(w, noise_mode='const', force_fp32=True). And I also want to know how to return the featrures of each layer in the self.G.

Thanks

danielroich commented 1 year ago

Hi @linziqu, The 'noise mode' indicates how the noise injected into StyleGAN behaves. StyleGAN actually receives 2 inputs. The latent code and a noise vector can be seen in the original paper. The force_fp handles the float operations when computed in the generator. You can read more in the official documentation "https://github.com/NVlabs/stylegan2-ada-pytorch".

Regarding the features - you can access the StyleGAN layers and thus the weights directly as any other NN in PyTorch. But again I highly recommend reading the official documentation for further instructions.