Revisiting Discriminator in GAN Compression: A Generator-discriminator Cooperative Compression Scheme (NeurIPS2021) (Link)
- Linux
- Python 3
- CPU or NVIDIA GPU + CUDA CuDNN
-
Please type the command
pip install -r requirements.txt
to install dependencies.
- cityscapes
- horse2zebra
- celeb
- Coco, Set5, Set14, B100, Urban100
We provide a list of pre-trained models in link.
-
Run the following script to pretrain a pix2pix on cityscapes dataset for generator pruning, all scripts for sagan, cyclegan, pix2pix, srgan can be found in ./scripts
bash scripts/pix2pix/pretrain_for_pruning.sh
-
train lightweight generator using GCC
bash scripts/pix2pix/train.sh
-
test resulted models, FID or mIoU will be calculated, take pix2pix generator on cityscapes dataset as an example
bash scripts/pix2pix/test.sh
Our code is developed based on DMAD, Self-Attention-GAN, pytorch-CycleGAN-and-pix2pix, a-PyTorch-Tutorial-to-Super-Resolution.