YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Photo-to-Emoji Transformation with TraVeLGAN and Perceptual Loss
Pytorch implementation of Thesis project entitled "Photo-to-Emoji Transformation with TraVeLGAN and Perceptual Loss" (or in Chinese, "εΊζΌTraVeLGANθPerceptual Lossε―¦ηΎη §β½θ½ζ葨ζ 符θδΉζβ½€")
Getting Started (Training)
Steps:
Download all of the files and folders in this repo and prepare the dataset. In my project, in this project we used CelebA dataset and Bitmoji dataset run
python create_emojis.pyand set the number of bitmoji images on thenum_emojisvariable.Put the training CelebA dataset inside
dataset/CelebA/trainA/folder, and test CelebA dataset insidedataset/CelebA/test.Put all the Bitmoji dataset inside
dataset/Bitmojifolder.Set up the config file inside
configs/cifar.json. Generally, You can determine the number of epochs, n_save_steps, and batch_size. I usebatch_size=32for faster converged.Run program using command
python train.py --log log_photo2emoji --project_name photo2emoji
Testing
Steps:
Change the
saved_modelkey inconfig.jsonto be./log_photo2emoji/model_500.ptor whenever number of iteration model you use.run program using command
python testAtoB.py --project_name photo2emoji --log log_photo2emoji
NB: You could download the pretrained model from this link OneDrive Link, and place it in log_photo2emoji folder
Folder structure
The following shows basic folder structure.
βββ configs # config.json folder
βββ dataset
β βββ CelebA # Domain A (not included in this repo)
β β βββ trainA
β β βββ trainA_pair # edge-promoting results of CelebA to be saved here
β |
β |ββ Bitmoji # Domain B (not included in this repo)
β | βββ trainB
| | βββ trainB_pair # edge-promoting results of Bitmoji to be saved here
| |
| |ββ bitmoji_api_info.md
| |ββ create_emojis.py
| βββ create_emojis_parallel.py
|
βββ networks
| βββ default.py # the Generator, Discriminator, Siamese network
|
βββ photo2emoji # will be created using --project_name photo2emoji command
βββ log_photo2emoji
| βββ model_500.pt # download this file (link at Pretrained Section)
|
βββ samples # result samples folder
βββ edge_promoting.py
βββ losses.py # loss functions code
βββ testAtoB.py # test code
βββ train.py
βββ trainer.py
βββ utils.py
Result Samples
Comparison
- TraVeLGAN (Original)
- TraVeLGAN + Perceptual Loss
Pretrained Model
You can download the pretrained model (after 500 epochs) of this implementation in OneDrive Link
Acknowledgments
This implementation code is inspired by



















