InterDigitalInc / latent-transformer

Official implementation for paper: A Latent Transformer for Disentangled Face Editing in Images and Videos.
https://arxiv.org/abs/2106.11895
Other
143 stars 22 forks source link

Using StyleGAN.get_latent instead of pipxel2style2pixel encoder #5

Closed zhongtao93 closed 2 years ago

zhongtao93 commented 2 years ago

Hi, it's ineffective when I use StyleGAN.get_latent instead of using pipxel2style2pixel encoder.

w_0 = trainer.StyleGAN.get_latent(torch.randn(1, 512, device=device)).repeat(1, 18, 1)

The first column is generate image using w_o as above, the remaining four is teaser_attrs as the same of source code in figure_sequential_edit.ipynb image

Xu-Yao commented 2 years ago

Hi, the pSp encoder maps a real image to an extended latent space W+, where each latent is different for the 18 layers. In the original latent space of StyleGAN, the 18 layers use the same latent w, as you did in this example. Our pretrained model is trained in the latent space W+ obtained with pSp encoder, such that the behavior will not be the same as in the original latent space. Maybe you can try to increase the scaling factor to see more editing effects. If you want to perform editing on synthetic images, you need to train the latent transformer in the original latent space.