genforce / idinvert

[ECCV 2020] In-Domain GAN Inversion for Real Image Editing
https://genforce.github.io/idinvert/
MIT License
461 stars 65 forks source link

Training an encoder using pretrained StyleGAN #45

Closed basitanees closed 3 years ago

basitanees commented 3 years ago

Hi,

I wanted to ask if there are any pretrained models linked with this repository that do not include the encoder. The one linked with the repository readme ("styleganinv_face_256.pkl") has an encoder as well and when I use it for the train_encoder,py script, it unpacks 4 values (E, G, D, Gs) whereas in the code (training_loop_encoder.py - line 122), it expects 3 values (G,D,Gs). I fixed it by changing training_loop_encoder.py - line 122 from: G, D, Gs = misc.load_pkl(decoder_pkl.decoderpkl) to: , G, D, Gs = misc.load_pkl(decoder_pkl.decoder_pkl)

However, I am not sure if there are other models available that fit with the original code. I would appreciate any comments regarding this. Thank you.

zhujiapeng commented 3 years ago

The "styleganinv_face_256.pkl" file contains the encoder we have already trained. If you want a model with three values (G, D, Gs), you could train it yourself following the instruction in README.md.

捕获

basitanees commented 3 years ago

Thank you.