harskish / ganspace

Discovering Interpretable GAN Controls [NeurIPS 2020]
Apache License 2.0
1.78k stars 264 forks source link

Question: Pre-trained principal directions for ProgGAN/StyleGAN2 #34

Closed chi0tzp closed 3 years ago

chi0tzp commented 3 years ago

Hi, I'm interested in using your method for comparisons, and I would like to traverse the latent space of ProgGAN and StyleGAN2/W-space along the principal directions. More specifically, given a latent code z, I'm looking for a way to produce a new latent code z'= z + Ux, where U is the matrix of the principal directions and x is an one-hot vector determining which direction(s) to use. My question is whether there is a way to have/extract a pre-trained matrix U for ProgGAN (CelebA-HQ) and StyleGAN2 (FFHQ).

Thank you.

harskish commented 3 years ago

For stylegan2, you can call visualize.py (like the examples in the readme), and inspect the components here: https://github.com/harskish/ganspace/blob/master/visualize.py#L170 If visualize is called with --use_w, then data['lat_comp'] will contain the matrix U of directions in W. If you want directions in Z, then you can leave out the --use_w flag.

Unfortunately, the bundled ProGAN does not contain a pretrained CelebA-HQ model. Unfortunately I can't give any concrete tips on how to get that specific model up and running.