This is the official implementation of paper LinesToFacePhoto: Face Photo Generation from Lines with Conditional Self-Attention Generative Adversarial Network.
TensorFlow 1.8.0, Python 3.6, NumPy, scipy, PIL, tqdm
We use TFrecord file for our dataset. See /data.py and /tools/Image_mask_edge_df.py for details. Since the TFrecord file we use may be redundant, you can modify it to meet your need.
The face photo dataset we use is CelebA-HQ.
The method we use to get line maps is the same as that in SketchyGAN, which is basicall HED + postprocessing.
Distance fields (df's) are obtaind by distance transform.
The masks are not used in this project.
The pre-trained model can be download at BaiduPan(uploading..) or GoogleDrive
The data TFrecord file should be prepared as described above and put in /input. The pretrained model should be downloaded into /checkpoint/quad. Example script of testing can be found in /scripts.sh. The results are supposed to be in /output.
Pre-trained model: BaiduPan(uploading..) or GoogleDrive
@inproceedings{Li:2019:LFP:3343031.3350854,
author = {Li, Yuhang and Chen, Xuejin and Wu, Feng and Zha, Zheng-Jun},
title = {LinesToFacePhoto: Face Photo Generation From Lines With Conditional Self-Attention Generative Adversarial Networks},
booktitle = {Proceedings of the 27th ACM International Conference on Multimedia},
series = {MM '19},
year = {2019},
isbn = {978-1-4503-6889-6},
location = {Nice, France},
pages = {2323--2331},
numpages = {9},
url = {http://doi.acm.org/10.1145/3343031.3350854},
doi = {10.1145/3343031.3350854},
acmid = {3350854},
publisher = {ACM},
address = {New York, NY, USA},
keywords = {conditional generative adversarial nets, face, line map, realistic images, self-attention},
}
MRU code by SketchyGAN
Self-atttention modual code modified from Self-Attention-GAN-Tensorflow
Some code by pix2pix-tensorflow