BeautyGAN: Instance-level Facial Makeup Transfer with Deep Generative Adversarial Network
First :
pip install poetry
Second :
poetry install
In this code we using mtdataset
Structure like :
./mtdataset
├── images
│ ├── makeup
│ └── non-makeup
└── parsing
├── makeup
└── non-makeup
python train.py --data_path {your dataset path}
For Tensorboard:
tensorboard --logdir runs
, then open http://localhost:6006/
Run score :
python ./run_score.py --checkpoint "{model path}" --add_128 {resize image to 128}
Example :
python ./run_score.py --checkpoint "model/83_780/83_780_G.pth" --add_128 True
If you want to use this evaluation metric, you need prepare:
- mtdataset/images/non-makeup
- mtdataset/images/makeup
- mt_removal
- output_folder (the generated images)
The filenames of generated images should be as follows: pred_0.png, pred_1.png, .....
The order of generated images are the makuep_test.txt and nomakup_test.txt . For example, pred_0.png are generated by non-makeup/xfsy_0458.png and makeup/vHX44.png. non-makeup/xfsy_0458.png and makeup/vHX44.png are the first line of nomakeup_test.txt and makup_test.txt, respectively
+------------+-------------+----------+-----------+
| Approach | Precision | Recall | Overall |
+============+=============+==========+===========+
| mt | 0.959 | 0.001 | 0.029 |
+------------+-------------+----------+-----------+
This code is heavily based on BeautyGAN - Offical Pytorch Implementation and BeautyGAN-PyTorch-reimplementation. Thanks
wtjiang98
,thaoshibe
so much to make his work available 🙏🙏🙏 Package : Poetry Reference : TTUR