genforce / idinvert_pytorch

[ECCV 2020] In-Domain GAN Inversion for Real Image Editing (PyTorch code)
https://genforce.github.io/idinvert/
MIT License
407 stars 54 forks source link

Could I use the conditional boundaries from InterFaceGAN? #5

Closed Ivan-Fan closed 3 years ago

Ivan-Fan commented 3 years ago

Hi!

First of all, thanks for Genforce's kind share! It's really great work!

Recently, I am reading papers about Idinvert (this project) and InterFaceGAN and they really make me believe that these two works together would make some contribution if we want to do some real image editing in this field. So could I apply the conditional boundaries in the InterFaceGAN to the sematic manipulation of Idinvert project? What I found in the Idinvert project are some single boundaries. Besides, the shapes of the conditional boundaries in the InterFaceGAN project ($Z$ or $W$ space) are not compatible with the latent code of stylegan_ffhq256 in Idinvert project (I suppose they are $WP$ with (1, 14, 512) shape?). I am not sure whether I need to retrain the conditional boundaries for this? If you could offer some suggestions, that would be much help :)

By the way, I have another little quesion: there is one sentence called "Change repleated $w$ for all layers to different $w$s (Line 428-435 in file training/networks_stylegan.py)" in the repo. What does the word "repleated" mean? Or you mean "repeated"?

Thank you again for your great work!

ShenYujun commented 3 years ago

The model used in this work is different from the model in InterFaceGAN. That's why the boundaries in InterFaceGAN cannot be applied to this project. But the project_boundary() function (here) can be reused.

Yes, it is a typo. The word should be "repeated". In particular, in official StyleGAN, the w code, with shape (1, 512), is repeated multiple times before fed into each layer. We slightly modify the model by directly learning the wp code, with shape (14, 512).

Ivan-Fan commented 3 years ago

@ShenYujun Thanks a lot! I would look into the "project_boundary()" function later.