Code for the paper: "ExSinGAN: learning an explainable Generative Model from a Single Image (BMVC 2021)"
Our code refered to the following projects:
- SinGAN: https://github.com/tamarott/SinGAN
- DGP: https://github.com/XingangPan/deep-generative-prior
And we rewrited the SinGAN and DGP for more concise expression.
Please download Pretrained VGG and BigGAN from Google drive, and put them to Pretrained
folder.
pip install -r requirements.txt
To train ExSinGAN, just running
python main_train.py --input_dir <input_dir> --input_name <image>
e.g., if you has an image leaningtower.jpg
in Input/Images
, just run
python main_train.py --input_dir Input/Images --input_name leaningtower.jpg
For more details of parameters, please see Models/config.py
We also offered a script To train SinGAN, just running
python main_train.py --input_dir <input_dir> --input_name <image> --use_struct False --use_semantic False --rescale_method singan --pyramid_height None
Once the model is trained completely, the syntheses are stored in the Output
directory. You can sample more syntheses by running
python random_samples.py --model_path <model_path> --num <num>