Skip to content
Semi-Supervised Learning for Face Sketch Synthesis in the Wild, ACCV2018
Branch: master
Clone or download
Permalink
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
.gitignore
LICENSE Update license. Oct 17, 2018
README.md Update paper link to arxiv. Dec 13, 2018
download_data_models.sh Add download scripts. Oct 5, 2018
download_feature.sh
example_img.png Add example image. Oct 5, 2018
face2sketch_wild.py Add final pretrained models. Oct 12, 2018
test.py Update model path. Oct 14, 2018
train.py Update model path. Oct 14, 2018

README.md

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

Prerequisite

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

Datasets

  • 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.

Usage

Download data and pretrained models.

Download the datasets and pretrained models using the following scripts

bash download_data_models.sh

Quick Test

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

python test.py 1  # Test on CUFS test set
python test.py 2  # Test on CUFSF test set
python test.py 3  # Test on CUHK_Student test set
python test.py 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.

Train

  1. Download the precalculated features for fast patch matching.
bash download_feature.sh
  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.
python train.py

Citation

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

@inproceedings{chen2018face-sketch-wild,
    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)},
    year={2018},
}

Resources

[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.