yuval-alaluf / hyperstyle

Official Implementation for "HyperStyle: StyleGAN Inversion with HyperNetworks for Real Image Editing" (CVPR 2022) https://arxiv.org/abs/2111.15666
https://yuval-alaluf.github.io/hyperstyle/
MIT License
998 stars 115 forks source link

About editing real images #43

Closed JNash123 closed 2 years ago

JNash123 commented 2 years ago

Figure 1. Given a desired input image, our hypernetworks learn to modulate a pre-trained StyleGAN network to achieve accurate image reconstructions in editable regions of the latent space. Doing so enables one to effectively apply techniques such as StyleCLIP [54] and InterFaceGAN [64] for editing real images.

I have a question, if i have latent codes of real images(i use Learning-based GAN inversion methods to get latent codes, like pSp), do i need to get image reconstruction first? and then use stylegan-encoder to get latent codes again(like this one https://github.com/Puzer/stylegan-encoder), so i can use InterFaceGAN to edit image. (real image -----Learning-based GAN inversion---->reconstruction----stylegan_encoder-->latent codes----InterFaceGAN--->editing)

Why do i have this question, cuz i have bad result in editing real image (real image ------StyleGAN2-based encoder network--->latent codes, save as .npy ----InterFaceGAN---->bad result)

I'd appreciate it if you can answer my question.

yuval-alaluf commented 2 years ago

If you want to edit real images, the flow should be the following: Image --> Inversion -> Edit -> StyleGAN -> Edited Image The inversion can be done with many different methods (e.g., pSp, e4e, ReStyle, HyperStyle, PTI, and many more). However, some methods achieve better editing than other methods. For example, pSp usually gives poor editing since its not designed for that. But things like e4e and HyperStyle lead to better editing results since they're designed with editing in mind.

If you're interesting in playing around with different methods and their editing, you can take a look at the repos for each work. For example, take a look at this section in the readme for details on how to edit real images with HyperStyle: https://github.com/yuval-alaluf/hyperstyle#editing

JNash123 commented 2 years ago

If you want to edit real images, the flow should be the following: Image --> Inversion -> Edit -> StyleGAN -> Edited Image The inversion can be done with many different methods (e.g., pSp, e4e, ReStyle, HyperStyle, PTI, and many more). However, some methods achieve better editing than other methods. For example, pSp usually gives poor editing since its not designed for that. But things like e4e and HyperStyle lead to better editing results since they're designed with editing in mind.

If you're interesting in playing around with different methods and their editing, you can take a look at the repos for each work. For example, take a look at this section in the readme for details on how to edit real images with HyperStyle: https://github.com/yuval-alaluf/hyperstyle#editing

If you want to edit real images, the flow should be the following: Image --> Inversion -> Edit -> StyleGAN -> Edited Image The inversion can be done with many different methods (e.g., pSp, e4e, ReStyle, HyperStyle, PTI, and many more). However, some methods achieve better editing than other methods. For example, pSp usually gives poor editing since its not designed for that. But things like e4e and HyperStyle lead to better editing results since they're designed with editing in mind.

If you're interesting in playing around with different methods and their editing, you can take a look at the repos for each work. For example, take a look at this section in the readme for details on how to edit real images with HyperStyle: https://github.com/yuval-alaluf/hyperstyle#editing

thank u