# GANSpace: Discovering Interpretable GAN Controls

This repository is the reprodcution of [GANSpace: Discovering Interpretable GAN Controls](https://arxiv.org/abs/2004.02546). 

The `figure_*.py` scripts correspond to the Figures in the original paper.

## TODO: 
1. Reproduce BigGAN512-deep results from the original paper.
2. Implement the visualize and interactive code from original GANSpace implementation.


## Note:
1. There is an issue downloading StyleGAN1 pretrained datasets directly from the code.
    The following workaround is used to overcome this issue:
   - Download the respective dataset from [NVlabs](https://github.com/NVlabs/stylegan/blob/master/generate_figures.py)
     or from [awesome-pretrained-stylegan](https://github.com/justinpinkney/awesome-pretrained-stylegan) (the URLs
     can also be found in the `get_hash` function of `utils.py`)
   - Calculate the hash of the URL using the `get_hash` function
   - Prepend the downloaded file with `<hash>_`, and place it inside the `.stylegan2-cache` folder
2. For StyleGAN2 pretrained datasets that are available in `.xz` extension from
   [awesome-pretrained-stylegan2](https://github.com/justinpinkney/awesome-pretrained-stylegan2):
   - Download the respective dataset and extract the contents to get the `.pkl` file
   - Calculate the hash of the URL using the `get_hash` function
   - Prepend the extracted file with `<hash>_`, and place it inside the `.stylegan2-cache` folder 