/CoopNets

Cooperative Training of Descriptor and Generator Networks

Primary LanguagePythonMIT LicenseMIT

Cooperative Training of Descriptor and Generator Networks

This repository contains a tensorflow implementation for the paper "Cooperative Training of Descriptor and Generator Networks".

Project Page: (http://www.stat.ucla.edu/~jxie/CoopNets/CoopNets.html)

Reference

@article{coopnets,
    author = {Xie, Jianwen and Lu, Yang and Gao, Ruiqi and Zhu, Song-Chun and Wu, Ying Nian},
    title = {Cooperative Training of Descriptor and Generator Networks},
    journal={IEEE transactions on pattern analysis and machine intelligence (PAMI)},
    year = {2018},
    publisher={IEEE}
}

Related code

For Experiment 7 (dynamic texture synthesis by Spatial-temporal CoopNets), please go to https://github.com/jianwen-xie/Spatial-Temporal-CoopNets

Requirements

Usage

(1) For scene synthesis

(i) Training

First, prepare your data into a folder, for example ./data/scene/rock

To train a model with rock dataset:

$ python main.py --category rock --data_dir ./data/scene --output_dir ./output --net_type scene --image_size 64

The synthesized results will be saved in ./output/rock/synthesis.

The learned models will be saved in ./output/rock/checkpoints.

If you want to calculate inception score, use --calculate_inception=True.

(ii) Testing for image synthesis

$ python main.py --test --test_type syn --category rock --net_type scene --image_size 64 --output_dir ./output --ckpt ./output/rock/checkpoints/model.ckpt-82000

testing results will be saved in ./output/rock/test/synthesis

(iii) Testing for interpolation

To test generator by synthesizing interpolation results with trained model:

$ python main.py --test --test_type inter --category rock --net_type scene --image_size 64 --output_dir ./output --ckpt ./output/rock/checkpoints/model.ckpt-82000

testing results will be saved in ./output/rock/test/interpolation

(2) For MNIST handwritten digits synthesis

If category is mnist, training data will be downloaded automatically

$ python main.py --category mnist --net_type mnist --image_size 28

The training data will be saved in folder ./MNIST-data

If you want to calculate parzen window-based log-likelihood, use --calculate_parzen=True.

The synthesized results will be saved in ./output/mnist/synthesis.

The learned models will be saved in ./output/mnist/checkpoints.

Results

Synthesis

Interpolation

For any questions, please contact Jianwen Xie (jianwen@ucla.edu), Ruiqi Gao (ruiqigao@ucla.edu) and Zilong Zheng (zilongzheng0318@ucla.edu)