rolux / stylegan2encoder

StyleGAN2 - Official TensorFlow Implementation
http://arxiv.org/abs/1912.04958
Other
380 stars 71 forks source link

Low accuracy for generated image from my own image using project_image.py #22

Closed ymzlygw closed 3 years ago

ymzlygw commented 3 years ago

Thanks for your work! I want to know why I got the not very good generated image for my own image. I take a photo using my phone and try to get the dlatents. I follow the guide and run the 'align_images.py' and 'project_images.py' , here is the result:

Origin image:

z

After project_image.py:

z

I don't think this two image are the same person. Could you please tell me why I generated the result from real-face image?

Another question is that some time when I use 'align_images.py', but there is no generated image in 'align', and then I can't use 'project_images.py' to get the dlatent of image(.jpg)

cyremur commented 3 years ago

This happens because the model generated from the FFHD is not proficient enough to recreate every face 100% faithfully. There is no real solution to this instead of trying a couple times and getting something close enough. The only remedy would be training a better model with a better face dataset that includes more images similar to the one you want to generate.

ymzlygw commented 3 years ago

This happens because the model generated from the FFHD is not proficient enough to recreate every face 100% faithfully. There is no real solution to this instead of trying a couple times and getting something close enough. The only remedy would be training a better model with a better face dataset that includes more images similar to the one you want to generate.

Thanks for your reply! Another problem is that every time when I want to align a image of mine, I got a image with blurred edges instead,as follows: Origin image: z02e aligned image: z02ex It always happens when I input a photo of mine that took by phone.Could you please tell me how to solve it?thanks

cyremur commented 3 years ago

This happens because the align script tries to fit your face into a square with face landmarks at certain positions. Your selfie is too close, therefore the original picture doesn't cover the entire square. I assume the artifacts on the side are created by the align algorithm trying to expand your picture to cover that square.

TL;DR: Try taking the picture from a bit further away with more background.

ymzlygw commented 3 years ago

This happens because the align script tries to fit your face into a square with face landmarks at certain positions. Your selfie is too close, therefore the original picture doesn't cover the entire square. I assume the artifacts on the side are created by the align algorithm trying to expand your picture to cover that square.

TL;DR: Try taking the picture from a bit further away with more background.

Wow, Thanks a lot! I have been troubled by this problem for a long time。I'll try it next.