Skip to content

JeffCarpenter/ca-gan

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CA-GAN

We provide PyTorch implementation for our CYB paper "Towards Realistic Face Photo-Sketch Synthesis via Composition-Aided GANs"

[paper]

Our Proposed Framework

Sample Result

left: sketch synthesis; right: photo synthesis

(a)Input Image, (b)cGAN, (c)CA-GAN, (d)SCA-GAN

Citation

If you find this useful for your research, please use the following.

@article{gao2017ca-gan,
	title = {Towards Realistic Face Photo-Sketch Synthesis via Composition-Aided GANs},
	author = {Jun Yu, Xingxin Xu, Fei Gao, Shengjie Shi, Meng Wang, Dacheng Tao, and Qingming Huang},
	booktitle = {arXiv:1712.00899},
	year = {2019},
}

Prerequisites

  • Linux or similar environment
  • Python 2.7
  • NVIDIA GPU + CUDA CuDNN

Getting Started

Installation

  • Clone this repo:
    git clone https://github.com/jehovahxu/ca-gan
    cd ca-gan
  • Install PyTorch 0.4+ and torchvision from http://pytorch.org and other dependencies (e.g., visdom and dominate). You can install all the dependencies by
    pip install -r requirments.txt

ca-gan train/test

  • Download a dataset(CUFS split train and test with this files)

  • Download the VGG-Face model which based on the VGG-Very-Deep-16 CNN architecture. Here we convert torch weight to pyTorch to fit our frame, you can download our converted model directly.

  • Get face parsing

    • here we use Face Labling to get face parsing
    • Check out the branch to get the our newly used
  • Train a model

    python main.py --model_vgg {model path}
  • Test the model

    python test.py --dataroot {data path} --fold {epoch number}
    • The option fold is used for load ./checkpoint/netG_epoch_'+fold+'.weight and you can edit it in test.py

Apply a pre-trained model

  • You can download a pre-trained model which trained on the CUSF and can transform photo to sketch :

  • The pre-trained model need to be save at ./checkpoint and named it as netG_epoch_'+fold+'.weight

  • Then you can test the model

Datasets

Result

Training/Test Tips

Best practice for training and testing your models.

Feel free to ask any questions.Xingxin Xu, jehovahxu@gmail.com

Acknowledgments

Our code is inspired by pytorch-CycleGAN-and-pix2pix

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%