narisada014 / beautyGAN-reimplement

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BeautyGAN

BeautyGAN: Instance-level Facial Makeup Transfer with Deep Generative Adversarial Network

intro.png
This image is from BeautyGAN

This is a modification of Offical Pytorch code for BeautyGAN. The main differences are:

  • Dataloaders
  • Identities Loss (VGG)
  • Add Tensorboard

🌿 If you have trouble running this code, feel free to send me an issue. I'll try my best to help you πŸ‘.

NOTE:: I got serveral checkpoint in Google Drive. The results are not good as stated in the main paper, but check it if you like.

For the best results, I recommend original tensorflow pre-trained model


Requirements

First, clone this repo:

git clone https://github.com/thaoshibe/BeautyGAN-pytorch-reimplementation.git

&

cd BeautyGAN-pytorch-reimplementation

Install all required python packages:

  • Via pip: pip install -r requirements.txt
  • Via conda: conda env create -f environment.yml (then conda activate beautygan)

Datasets

Please download the Makeup Transfer Dataset.

Training Code

python train.py --data_path /path/to/dataset

For example: I downloaded Makeup Transfer Dataset to /home/ubuntu/makeup_dataset/. So the command will be python train.py --data_path /home/ubuntu/makeup_dataset/

  • For Tensorboard: tensorboard --logdir runs, then open http://localhost:6006/

Results Snapshot
result.png
Results at epoch 80. From left to right: Original Image, Makeup Reference, Result
Tensorboard Snapshot

Tensorboard captured at epoch 0. The results are unpleasant at this time. Don't worry πŸ”₯. To get the final model, I trained the model until epoch 200 (about ONE WEEEK in RTX 1080Ti)

tensorboard_loss.png
Tensorboard Loss
tensorboard_images.png
Tensorboard Image. First rows are fake images (results). Second are original images (inputs). Third are recycle images (reconstructed images)

Acknowledgement

This code is heavily based on BeautyGAN - Offical Pytorch Implementation. Thanks wtjiang98 so much to make his work available πŸ™πŸ™πŸ™

About

License:MIT License


Languages

Language:Python 100.0%