Skip to content
/ SpMT Public
forked from AnonymScholar/SpMT

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

License

Notifications You must be signed in to change notification settings

bwubuw/SpMT

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpMT

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

cover

Requirements

  • Ubuntu 18.04
  • Anaconda (Python, Numpy, PIL, etc.)
  • PyTorch 1.7.1
  • torchvision 0.8.2

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:

  • Use images of MT dataset:
opt.dataroot
├── images
│   ├── makeup
│   └── non-makeup
├── parsing
│   ├── makeup
│   └── non-makeup
├── makeup_test.txt
├── non-makeup_test.txt
  • Use arbitrary images:
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:

  • Available demo mode: 'normal', 'interpolate', 'removal', 'multiple_refs', 'partly'

  • For part-specific makeup transfer(opt.demo_mode='partial'), make sure there are at least 3 reference images.

  • For interpolation between multiple references, make sure there are at least 4 reference images.

Use arbitrary images:

python demo_general.py  --beyond_mt

Results

Shade-controllable

  • Interpolation from light to heavy

shade1

  • Interpolation between multiple references

shade2

Part-specific

Transfer different parts from different references

part

Makeup Removal

removal

Comparison with Prior Arts

  • Normal Images

normal

  • Wild Images

wild1 wild2

Acknowledgments

This code borrows some function from SPADE and SCGAN

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%