Skip to content
Semi-Supervised Learning for Face Sketch Synthesis in the Wild, ACCV2018
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
data_process Simplify code according to the paper draft. Aug 6, 2018
models Improve and stablize code. Aug 21, 2018
utils Improve codes. Oct 12, 2018
LICENSE Update license. Oct 17, 2018 Update paper link to arxiv. Dec 13, 2018 Add download scripts. Oct 5, 2018
example_img.png Add example image. Oct 5, 2018 Add final pretrained models. Oct 12, 2018 Update model path. Oct 14, 2018 Update model path. Oct 14, 2018

Face Sketch Synthesis in the Wild

PyTorch implementation for face sketch synthesis in the wild through semi-supervised learning. Here is an example:

Semi-Supervised Learning for Face Sketch Synthesis in the Wild.
Chaofeng Chen, Wei Liu, Xiao Tan, Kwan-Yee K. Wong.

Getting Started


  • Pytorch 0.3
  • torchvision 0.2
  • opencv-python
  • matlab_wrapper
  • Matlab (For FSIM evaluation)


  • We use CUFS and CUFSF dataset provided by Chinese University of Hong Kong (CUHK) to train our networks. You can also download them from HERE.
  • For the training of in the wild images, we use a subset of VGG-Face.


Download data and pretrained models.

Download the datasets and pretrained models using the following scripts


Quick Test

After download the datasets and pretrain models, use the provided script to test the model

python 1  # Test on CUFS test set
python 2  # Test on CUFSF test set
python 3  # Test on CUHK_Student test set
python 4  # Test on VGG test set

You can also test on your own test dataset. Simply change the --test_dir and --test_weight_path. If you have ground truth images, you can also specify --test_gt_dir.


  1. Download the precalculated features for fast patch matching.
  1. Configure training process.
  • vgg_select_num [0 or 10]. 0: no extra images in training. 10: extra VGG-Face in training. Only the largest vgg10 is provided here.
  • train_style [cufs, cufsf]. use cufs or cufsf as the reference style.

The models in the paper are trained under 3 configurations:

  • --vgg_select_num 0 --train_style cufs. Model evaluated on CUFS.
  • --vgg_select_num 0 --train_style cufsf. Model evaluated on CUFSF.
  • --vgg_select_num 10 --train_style cufs. Model evaluated on VGG-Face.
  1. Train the model.


If you find this code or the provided data useful in your research, please consider cite:

    title={Semi-Supervised Learning for Face Sketch Synthesis in the Wild},
    author={Chen, Chaofeng and Liu, Wei and Tan, Xiao and Wong, KKY},
    booktitle={Asian Conference on Computer Vision (ACCV)},


[1] Random Sampling and Locality Constraint for Face Sketch Synthesis
[2] Real-Time Exemplar-Based Face Sketch Synthesis

You can’t perform that action at this time.