mchong6 / JoJoGAN

Official PyTorch repo for JoJoGAN: One Shot Face Stylization
MIT License
1.42k stars 206 forks source link

Different results with automatic alignment and manual crop #37

Closed 007prateekd closed 2 years ago

007prateekd commented 2 years ago

I took a picture with a face in it and generated an image using the align_face function. Then, using the same picture, I generated another image by manual cropping as mentioned in https://github.com/mchong6/JoJoGAN/issues/18#issuecomment-1008996040. When I pass both of these through the e4e_projection function and view the final image, the results are very different although the images which were passed are very similar. Do you have any idea of why this might be?

007prateekd commented 2 years ago

Turns out that the GAN inversion is highly sensitive to alignment. The face needs to be aligned perfectly for it to work accurately. A little change here and there gives quite different results. For example, given this image, here are 3 inverted outputs using:

  1. automatic alignment Figure_4
  2. accurate manual alignment Figure_5
  3. inaccurate manual alignment Figure_3