Skip to content

Latest commit

 

History

History
56 lines (39 loc) · 1.87 KB

README.md

File metadata and controls

56 lines (39 loc) · 1.87 KB

ExSinGAN

Code for the paper: "ExSinGAN: learning an explainable Generative Model from a Single Image (BMVC 2021)"

code

Our code refered to the following projects:

And we rewrited the SinGAN and DGP for more concise expression.

Download pre-trained models

Please download Pretrained VGG and BigGAN from Google drive, and put them to Pretrained folder.

Install dependencies

pip install -r requirements.txt

Train

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

Random samples

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>