Code Monkey home page Code Monkey logo

crd's Introduction

Exploring Content Relationships For Distilling Efficient GANs

Overview

overview

Prerequisites

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

Getting Started

Installation

  • Clone this repo:

    git clone https://github.com/CRD-Official/CRD.git
    cd CRD
  • Install dependencies.

    conda create -n CRD python=3.7
    conda activate CRD
    pip install torch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 
    pip install -r requirements.txt 

Data preparation

  • edges2shoes

    • Download the dataset
    bash datasets/download_pix2pix_dataset.sh edges2shoes-r
    • Get the statistical information for the ground-truth images for your dataset to compute FID.
    bash datasets/download_real_stat.sh edges2shoes-r B
  • horse2zebra

    • Download the dataset
    bash datasets/download_cyclegan_dataset.sh horse2zebra
    • Get the statistical information for the ground-truth images for your dataset to compute FID.
    bash datasets/download_real_stat.sh horse2zebra A
    bash datasets/download_real_stat.sh horse2zebra B
  • summer2winter

    • Download the dataset
    bash datasets/download_cyclegan_dataset.sh summer2winter_yosemite
    • Get the statistical information for the ground-truth images for your dataset to compute FID from here

Pretrained Model

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

Training

  • pretrained vgg16 we should prepare weights of a vgg16 to calculate the style loss

  • train student model using CRD Run the following script to train a resnet-style student on horse2zebra dataset, all scripts for cyclegan and pix2pix on horse2zebra, summer2winter, and edges2shoes can be found in ./scripts

    bash scripts/cycle_gan/horse2zebra/distill.sh

Testing

  • test student models, FID will be calculated, take resnet-style generator on horse2zebra dataset as an example

    bash scripts/cycle_gan/horse2zebra/test.sh

Acknowledgements

Our code is developed based on GAN Compression and OMGD

crd's People

Contributors

thekernelz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.