Puzer / stylegan-encoder

StyleGAN Encoder - converts real images to latent space
Other
1.07k stars 166 forks source link

I am trying to obtain the same result with pytorch. #10

Open nile649 opened 5 years ago

nile649 commented 5 years ago

I did the encoding like the author of this github has mentioned. VGG = Perceptual model G = Generator model G.style() is the fully connected encoder in generator which gives dlatent code.

First question After optimizing perceptual loss between G and VGG, do I need to save the weights of G.style(), or pass random vector to G.style() save the output from G.style() which is dlatent.

Second Question If the first approach is right, than I proceed by getting attributes of the face using microsoft cognitive api. I tried on just 860 images to begin with. I do get the result but it is wrong. image

nile649 commented 5 years ago

image image

nile649 commented 5 years ago

Smile direction. image

image

bayminbx commented 4 years ago

@nile649 Do you obtain the same result with pytorch? Can you share you code???Thank you.

drprajapati commented 4 years ago

https://github.com/jacobhallberg/pytorch_stylegan_encoder/blob/master/train_image_to_latent_model.ipynb