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:

  1. 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.py and set the number of bitmoji images on the num_emojis variable.

  2. Put the training CelebA dataset inside dataset/CelebA/trainA/ folder, and test CelebA dataset inside dataset/CelebA/test.

  3. Put all the Bitmoji dataset inside dataset/Bitmoji folder.

  4. Set up the config file inside configs/cifar.json. Generally, You can determine the number of epochs, n_save_steps, and batch_size. I use batch_size=32 for faster converged.

  5. Run program using command

python train.py --log log_photo2emoji --project_name photo2emoji  

Testing

Steps:

  1. Change the saved_model key in config.json to be ./log_photo2emoji/model_500.pt or whenever number of iteration model you use.

  2. 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

12345

678910

Comparison

  1. TraVeLGAN (Original)

12345

  1. TraVeLGAN + Perceptual Loss

12345

Pretrained Model

You can download the pretrained model (after 500 epochs) of this implementation in OneDrive Link

Acknowledgments

This implementation code is inspired by

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support