rosinality / style-based-gan-pytorch

Implementation A Style-Based Generator Architecture for Generative Adversarial Networks in PyTorch
Other
1.1k stars 232 forks source link

StyleGan Encoder #87

Open zacharyclam opened 4 years ago

zacharyclam commented 4 years ago

First, thank you for this implementation! I want to train a StyleGAN Encoder.How to get the latent latent code after training?Is is the styles in StyledGenerator?But its shape is always [1,512] in different image size. Thank you!

rosinality commented 4 years ago

You can use generator.style to map random noises to latent codes. If you mean the encoder that maps images to the latent codes, currently this repo doesn't have script or models for that.

zacharyclam commented 4 years ago

Thank you!I want to encoder that maps images to the latent codes.But when l read other implements of styleGan Encoder,I found that the latent codes' shape is [18,512].I don't know which parameter in your code is latent code.

rosinality commented 4 years ago

Current implementation doesn't supports to use different latent codes for each layers. You need to modify this parts: https://github.com/rosinality/style-based-gan-pytorch/blob/master/model.py#L436.