Revisiting Discriminator in GAN Compression: A Generator-discriminator Cooperative Compression Scheme (NeurIPS2021)

Related tags

Deep Learning GCC
Overview

Revisiting Discriminator in GAN Compression: A Generator-discriminator Cooperative Compression Scheme (NeurIPS2021)

Overview

overview

Prerequisites

  • Linux
  • Python 3
  • CPU or NVIDIA GPU + CUDA CuDNN

Getting Started

Installation

  • Please type the command

    pip install -r requirements.txt

    to install dependencies.

Data preparation

  • cityscapes
  • horse2zebra
  • celeb
  • Coco, Set5, Set14, B100, Urban100

Pretrained Model

We provide a list of pre-trained models in link.

Pre-Training For Pruning

  • 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

Training

  • train lightweight generator using GCC

    bash scripts/pix2pix/train.sh

Testing

  • test resulted models, FID or mIoU will be calculated, take pix2pix generator on cityscapes dataset as an example

    bash scripts/pix2pix/test.sh

Acknowledgements

Our code is developed based on DMAD, Self-Attention-GAN, pytorch-CycleGAN-and-pix2pix, a-PyTorch-Tutorial-to-Super-Resolution.

Comments
  • Request for Pretrained Model of SRGAN

    Request for Pretrained Model of SRGAN

    Hi.

    Do you have a plan to release the model and the pruned one of SRGAN which are trained for 130 epochs that the authors use pretrain_for_pruning.sh and train.sh ???

    Thanks!

    opened by kminsoo 7
  • CelebA Dataset

    CelebA Dataset

    Hi, thanks for your nice repository. I have two questions:

    1. I could not find the dataset downloading and partitioning codes in the [datasets](https://github.com/SJLeo/GCC/tree/main/datasets) directory for the CelebA dataset. I manually downloaded it, and it has train, valid, and test in its PyTorch implementation. The code here anticipates the directory ./dataset/celeb/train. I would appreciate it if you elaborate on the possible connection between the partitioning schemes.
    2. I ran the training and testing codes for bash commands for SAGAN and it seems that the phase argument is train in both settings. Am I doing something wrong or is it what it should be as the dataset will be set to train in both situations in this line of the code in the current setting.

    Thank you in advance.

    opened by Alii-Ganjj 5
  • Will model be further enhanced efficiency with separable convolution?

    Will model be further enhanced efficiency with separable convolution?

    Thank you for your great work.

    I am wondering if model can be further enhanced efficiency with resnet? Because the resnet in pixel2pixel in your codes are separable convolution from efficientNet. Did you ever test it with your method?

    Looking forward to your reply.

    opened by kasim0226 1
  • reducing the memory usage of get_real_stat.py

    reducing the memory usage of get_real_stat.py

    @SJLeo hi there,

    get_real_stat.py requires alot of memory when using a large dataset, the solution could be by storing the image tensor on the disk and then modifying the dataloader to restore the tensors from the disk.

    This issue was discussed in here

    opened by seekingdeep 1
  • Question: why doing inference at val-set when using darts_discriminator

    Question: why doing inference at val-set when using darts_discriminator

    In train.py, line 147: if opt.darts_discriminator and model.teacher_model is not None: val_data = next(val_dataloader) model.set_input(val_data) model.clipping_mask_alpha() model.optimizer_netD_arch() Why do you inference on val-set when using darts_discriminator? And in this situation, length of val should equal to length of train, so it will cause a bug

    opened by HuaZheLei 1
  • Cyclegan_binarysearch_cfg not working.

    Cyclegan_binarysearch_cfg not working.

    Thank you for your great work.

    Unfortunately, I tried to pruning after pretraining cyclegan, but in the cyclegan_binarysearch_cfg code, the number of channels in on layer became 0 and an error occurred. May I know how to solve it? And after setting cfg_AtoB in cyclegna_binarysearch_cfg code, cfg_AtoB is manually set again on the next line, is there any reason to do this?

    Thanks

    opened by DJun0003 1
Owner
Shaojie Li
Shaojie Li
PyTorch implementation of Lip to Speech Synthesis with Visual Context Attentional GAN (NeurIPS2021)

Lip to Speech Synthesis with Visual Context Attentional GAN This repository contains the PyTorch implementation of the following paper: Lip to Speech

null 6 Nov 2, 2022
An Image compression simulator that uses Source Extractor and Monte Carlo methods to examine the post compressive effects different compression algorithms have.

ImageCompressionSimulation An Image compression simulator that uses Source Extractor and Monte Carlo methods to examine the post compressive effects o

James Park 1 Dec 11, 2021
Code for the paper "Training GANs with Stronger Augmentations via Contrastive Discriminator" (ICLR 2021)

Training GANs with Stronger Augmentations via Contrastive Discriminator (ICLR 2021) This repository contains the code for reproducing the paper: Train

Jongheon Jeong 174 Dec 29, 2022
Multi-scale discriminator feature-wise loss function

Multi-Scale Discriminative Feature Loss This repository provides code for Multi-Scale Discriminative Feature (MDF) loss for image reconstruction algor

Graphics and Displays group - University of Cambridge 76 Dec 12, 2022
Code for the CVPR 2021 paper "Triple-cooperative Video Shadow Detection"

Triple-cooperative Video Shadow Detection Code and dataset for the CVPR 2021 paper "Triple-cooperative Video Shadow Detection"[arXiv link] [official l

Zhihao Chen 24 Oct 4, 2022
A generalized framework for prototyping full-stack cooperative driving automation applications under CARLA+SUMO.

OpenCDA OpenCDA is a SIMULATION tool integrated with a prototype cooperative driving automation (CDA; see SAE J3216) pipeline as well as regular autom

UCLA Mobility Lab 726 Dec 29, 2022
[ACL-IJCNLP 2021] Improving Named Entity Recognition by External Context Retrieving and Cooperative Learning

CLNER The code is for our ACL-IJCNLP 2021 paper: Improving Named Entity Recognition by External Context Retrieving and Cooperative Learning CLNER is a

null 71 Dec 8, 2022
Implementation of a Transformer that Ponders, using the scheme from the PonderNet paper

Ponder(ing) Transformer Implementation of a Transformer that learns to adapt the number of computational steps it takes depending on the difficulty of

Phil Wang 65 Oct 4, 2022
Implementation of a Transformer that Ponders, using the scheme from the PonderNet paper

Ponder(ing) Transformer Implementation of a Transformer that learns to adapt the number of computational steps it takes depending on the difficulty of

Phil Wang 65 Oct 4, 2022
StyleGAN2 with adaptive discriminator augmentation (ADA) - Official TensorFlow implementation

StyleGAN2 with adaptive discriminator augmentation (ADA) — Official TensorFlow implementation Training Generative Adversarial Networks with Limited Da

NVIDIA Research Projects 1.7k Dec 29, 2022
The official codes of our CVPR2022 paper: A Differentiable Two-stage Alignment Scheme for Burst Image Reconstruction with Large Shift

TwoStageAlign The official codes of our CVPR2022 paper: A Differentiable Two-stage Alignment Scheme for Burst Image Reconstruction with Large Shift Pa

Shi Guo 32 Dec 15, 2022
[ICRA 2022] An opensource framework for cooperative detection. Official implementation for OPV2V.

OpenCOOD OpenCOOD is an Open COOperative Detection framework for autonomous driving. It is also the official implementation of the ICRA 2022 paper OPV

Runsheng Xu 322 Dec 23, 2022
Online Multi-Granularity Distillation for GAN Compression (ICCV2021)

Online Multi-Granularity Distillation for GAN Compression (ICCV2021) This repository contains the pytorch codes and trained models described in the IC

Bytedance Inc. 299 Dec 16, 2022
FuseDream: Training-Free Text-to-Image Generationwith Improved CLIP+GAN Space OptimizationFuseDream: Training-Free Text-to-Image Generationwith Improved CLIP+GAN Space Optimization

FuseDream This repo contains code for our paper (paper link): FuseDream: Training-Free Text-to-Image Generation with Improved CLIP+GAN Space Optimizat

XCL 191 Dec 31, 2022
DR-GAN: Automatic Radial Distortion Rectification Using Conditional GAN in Real-Time

DR-GAN: Automatic Radial Distortion Rectification Using Conditional GAN in Real-Time Introduction This is official implementation for DR-GAN (IEEE TCS

Kang Liao 18 Dec 23, 2022
LoveDA: A Remote Sensing Land-Cover Dataset for Domain Adaptive Semantic Segmentation (NeurIPS2021 Benchmark and Dataset Track)

LoveDA: A Remote Sensing Land-Cover Dataset for Domain Adaptive Semantic Segmentation by Junjue Wang, Zhuo Zheng, Ailong Ma, Xiaoyan Lu, and Yanfei Zh

Kingdrone 174 Dec 22, 2022
Deep Markov Factor Analysis (NeurIPS2021)

Deep Markov Factor Analysis (DMFA) Codes and experiments for deep Markov factor analysis (DMFA) model accepted for publication at NeurIPS2021: A. Farn

Sarah Ostadabbas 2 Dec 16, 2022
[NeurIPS2021] Exploring Architectural Ingredients of Adversarially Robust Deep Neural Networks

Exploring Architectural Ingredients of Adversarially Robust Deep Neural Networks Code for NeurIPS 2021 Paper "Exploring Architectural Ingredients of A

Hanxun Huang 26 Dec 1, 2022
This codebase is the official implementation of Test-Time Classifier Adjustment Module for Model-Agnostic Domain Generalization (NeurIPS2021, Spotlight)

Test-Time Classifier Adjustment Module for Model-Agnostic Domain Generalization This codebase is the official implementation of Test-Time Classifier A

null 47 Dec 28, 2022