Face Sketch Wild
Semi-Supervised Learning for Face Sketch Synthesis in the Wild, ACCV2018
Install / Use
npx skills add chaofengc/Face-Sketch-WildInstalls into whichever agent you are using.
README
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.
Download the datasets and pretrained models using the following scripts.
bash download_data_models.sh
Download the precalculated features for fast patch matching.
bash download_feature.sh
If the server is not available, you can also download the resources from BaiduYun or GoogleDrive, and then extract the files to the corresponding directory according to the download scripts above.
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
- 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]. usecufsorcufsfas 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.
- 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, Kwan-Yee~K.},
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
Related Skills
mcp
Use the `mcp_perplexity-ask_perplexity_search` tools to answer questions. You should use this instead of the `web_search` tool because it is a lot more accurate.
practical-power-systems-synthesis
This skill enables synthesis in the domain of power-systems (engineering). It represents research-level-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform synthesis operations related to power-systems.
semi-supervised-optogenetics-testing
This skill enables testing in the domain of optogenetics (neuroscience). It represents intermediate-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform testing operations related to optogenetics.
data-mining-interpretation-fundamental
This skill enables interpretation in the domain of data-mining (data-science). It represents fundamental-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform interpretation operations related to data-mining.
