omertov / encoder4editing

Official implementation of "Designing an Encoder for StyleGAN Image Manipulation" (SIGGRAPH 2021) https://arxiv.org/abs/2102.02766
MIT License
945 stars 154 forks source link

How to embed this into StyleGAN-ada? #59

Closed JJack27 closed 2 years ago

JJack27 commented 3 years ago

Hi, thank you for your sharing. May I know how can I embed this encoder into a stylegan-ada?

omertov commented 3 years ago

Hi @JJack27! Can you elaborate on what you are interested in? Ill try to give a general answer:

  1. If you have a pretrained model from the StyleGAN-ADA repositories of NVIDIA, you can check out rosinality's stylegan2-pytorch repository for a conversion script which will create a checkpoint suitable for use in this repo.
  2. If you wish to integrate any of NVIDIAs repositories, you should add the files defining the stylegan generator, and replace all the calls to rosinality's stlyegan2 generator in this repo with the appropriate API of the NVIDIA repo.

Best, Omer

JJack27 commented 3 years ago

Hi @omertov !

Thank you for you fast reply. I'm trying for the option 2. May I know where did you call the styleGAN2 the most? So that I can investigate and analyze if it's possible to replace it with stylegan-ada.

Regards, Jack

omertov commented 3 years ago

Hi @JJack27, As in the pSp framework, the StyleGAM generator is located as the decoder of the pSp module, you should make sure that when we call the net.decoder at training/coach.py or self.decoder in models/psp.py the API calls are being properly replaced.

Best, Omer