Home

Awesome

Deep Plastic Surgery

<table border="0" width='100%' style="FONT-SIZE:15" > <tr align="center"> <td width="9.70%" align="left"><img src="./figures/teaser-a.png" alt="" width="99%" ></td> <td width="13.90%"><img src="./figures/teaser-b.gif" alt="" width="99%" ></td> <td width="20.40%"><img src="./figures/teaser-c.png" alt="" width="99%" ></td> <td width="9.70%"><img src="./figures/teaser-d.png" alt="" width="99%" ></td> <td width="13.90%"><img src="./figures/teaser-e.gif" alt="" width="99%" ></td> <td width="20.40%" align="right"><img src="./figures/teaser-f.png" alt="" width="99%" ></td> </tr> <tr align="center"> <td colspan="3">(a) controllable face synthesis</td> <td colspan="3">(b) controllable face editing</td> </tr> <tr align="center"> <td colspan="6"><img src="./figures/teaser-g.png" alt="" width="99%" ></td> </tr> <tr align="center"> <td colspan="6">(c) adjusting refinement level <em>l</em></td> </tr> </tr> <tr> <td colspan="6"><p style="text-align: justify; FONT-SIZE:12">Our framework allows users to (a) synthesize and (b) edit photos based on hand-drawn sketches. (c) Our model works robustly on various sketches by setting refinement level <em>l</em> adaptive to the quality of the input sketches, <em>i.e.</em>, higher <em>l</em> for poorer sketches, thus tolerating the drawing errors and achieving the controllability on sketch faithfulness. Note that our model requires no real sketches for training.</p></td> </tr> </table>

This is a pytorch implementation of the paper.

Shuai Yang, Zhangyang Wang, Jiaying Liu and Zongming Guo. Deep Plastic Surgery: Robust and Controllable Image Editing with Human-Drawn Sketches, accepted by European Conference on Computer Vision (ECCV), 2020.

[Project] | [Paper] | [Human-Drawn Facial Sketches]

Please consider citing our paper if you find the software useful for your work.

Usage:

Prerequisites

Install

git clone https://github.com/TAMU-VITA/DeepPS.git
cd DeepPS/src

Testing Example

python test.py --l 1.0
<img src="https://github.com/TAMU-VITA/DeepPS/blob/master/figures/2.jpg" width="60%" height="60%">
python test.py
<img src="https://github.com/TAMU-VITA/DeepPS/blob/master/figures/1.jpg" width="60%" height="60%">
python test.py --model_task EDT --input_name ../data/EDT/4.png \
--load_F_name ../save/ECCV-EDT-celebaHQ-F256.ckpt --model_name ECCV-EDT-celebaHQ
python test.py --help

Training Examples

<img src="https://github.com/TAMU-VITA/DeepPS/blob/master/figures/0.jpg" width="40%" height="40%">

Training on image synthesis task

python train.py --save_model_name PSGAN-SYN

Saved model can be found at ../save/

python train.py --train_path ../data/dataset64/ \
--max_dilate 9 --max_level 1 --use_F_level 1 \
--load_F_name ../save/ECCV-SYN-celeba-F64.ckpt --img_size 64 \
--save_model_name PSGAN-SYN-64 --AtoB

Training on image editing task

python train.py --model_task EDT \
--load_F_name ../save/ECCV-EDT-celebaHQ-F256.ckpt --save_model_name PSGAN-EDT

Saved model can be found at ../save/

python train.py --help

Contact

Shuai Yang

williamyang@pku.edu.cn