AnonymScholar / SpMT

PyTorch code for "Semi-parametric Makeup Transfer via Semantic-aware Correspondence"
MIT License
34 stars 4 forks source link

SpMT

PyTorch Code for arXiv "Semi-parametric Makeup Transfer via Semantic-aware Correspondence"

cover

Requirements

Prepare data

For training phase:

opt.dataroot=MT-Dataset
├── images
│   ├── makeup
│   └── non-makeup
├── parsing
│   ├── makeup
│   └── non-makeup
├── makeup.txt
├── non-makeup.txt

For testing phase:

opt.dataroot
├── images
│   ├── makeup
│   └── non-makeup
├── parsing
│   ├── makeup
│   └── non-makeup
├── makeup_test.txt
├── non-makeup_test.txt
opt.dataroot
├── images
│   ├── makeup
│   └── non-makeup
├── makeup_test.txt
├── non-makeup_test.txt

Facial masks of an arbitrary image will be obtained from the face parsing model (we borrow the model from https://github.com/zllrunning/face-parsing.PyTorch)

Train:

python train.py --phase train

Test:

  1. Check the file 'options/demo_options.py', change the corresponding cofigs if needed

  2. Create folder '/checkpoints/makeup_transfer/'

  3. Download the pre-trained model from Google Drive and put it into '/checkpoints/makeup_transfer/'

Use images of MT dataset:

python demo.py --demo_mode normal 

Notice:

Use arbitrary images:

python demo_general.py  --beyond_mt

Results

Shade-controllable

shade1

shade2

Part-specific

Transfer different parts from different references

part

Makeup Removal

removal

Comparison with Prior Arts

normal

wild1 wild2

Acknowledgments

This code borrows some function from SPADE and SCGAN