pbaylies / stylegan-encoder

StyleGAN Encoder - converts real images to latent space
Other
740 stars 182 forks source link

try optimize resnet50 instead of latent code #36

Closed xiaohaipeng closed 4 years ago

xiaohaipeng commented 4 years ago

after fintuning resnet,load resnet and generator together,then optimize resnet,can this way have better results?

pbaylies commented 4 years ago

I'm not quite sure what you're proposing, but I'm welcome to proofs of concept or code! The resnet is mainly used to provide an estimate of the latents as a starting point for encoding.

xiaohaipeng commented 4 years ago

i mean after you have an estimate of the latents,connect the resnet and genarator , finetune resnet to get the best latents. and i find after optimize the latent,generated-image looks blurry compared to the image generated by stylegan,does loss function lead to the effect?

pbaylies commented 4 years ago

You could try that, but you'd just end up with a resnet model that's fine-tuned for a single image.

xiaohaipeng commented 4 years ago

@pbaylies line 125 in perceptual_model.py,why sess.run([self.features_weight.initializer, self.features_weight.initializer]) twice?

pbaylies commented 4 years ago

For better or for worse, this was in @Puzer's original code as well.

xiaohaipeng commented 4 years ago

@pbaylies and i also want you help me make sure some details about stylegan:for images of1024 size,the w space is of[batchsize,18,512],after truncation ,get w+space of the same shape,how different of the two spaces?

pbaylies commented 4 years ago

Those are both w+, all truncation does is pull it more towards the center of the distribution.

xiaohaipeng commented 4 years ago

and,why do you use L1 loss on vgg features but use L2 loss on image pixels?what is your considerations when you design the five losses?

pbaylies commented 4 years ago

Trial and error :)

xiaohaipeng commented 4 years ago

haha,you must try much losses.and images generated by stylegan always have defects or flaws,what reason do you think cause that?