Skip to content

CartoonGAN implementation code with pytorch.

Notifications You must be signed in to change notification settings

hsl323/cartoonGAN_pytorch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CartoonGAN with pytorch

Abstract

CartoonGAN(in CVRP2018) implementation code with pytorch framework.

Environment

1. Modules

- python : 3.6.10
- pytorch : 1.6.0
- torchvision : 0.7.0

2. GPU

- k80 (Microsoft Azure VM server)
- Your GPU card must have at least 11GB of VRAM.

3. OS

- Ubuntu 18.04-LTS

4. Directory Structure

  .
  ├── Data
  │   └── train
  │       ├── cartoon
  │       │   └── 1
  │       ├── edge_smoothing
  │       │   └── 0
  │       └── real
  │           └── 0
  ├── Saved_model
  ├── src
  └── Train
      ├── Pretraining
      └── Training

"./Data/train/cartoon/1":

The directory to save cartoon image set to train models.

"./Data/train/edge_smoothing/0":

The directory to save edge smoothed cartoon image set to train models. You don't have to do anything to this directory.

"./Data/train/real/0":

The directory to save real image set to train models.

"./Saved_model":

After the training process is over, the generated weight files are saved in this directory.

"./src":

Only used for other tasks.

"./Train/Pretraining":

The intermediate results and weght files created during the pre-training process are saved.

"./Train/Training":

The intermediate validatino results and weght files(every 5 epoch) created during the main-training process are saved.

How to train models

  1. If you want to train models, put the cartoon image set in "Data/cartoon/1/" directory. and put the real image set in "Data/real/0" directory.
  2. Open the Train.py and edit the parameters at line 20-41.
  3. Execute Train.py. (It takes a very long time.)

Our train results

We used cartoon image set from Tom and Jerry animation to train models. And Flickr 8k dataset is used for real image set. Each label contains about 20,000 images.

Initialize

Original Epoch 1 Epoch 5 Epoch 10
Original_1 Epoch_1_1 Epoch_4_1 Epoch_9_1
Original_2 Epoch_1_2 Epoch_4_2 Epoch_9_2
Original_3 Epoch_1_3 Epoch_4_3 Epoch_9_3
Original_4 Epoch_1_4 Epoch_4_4 Epoch_9_4

After Train

Origianl Converted
Original_1 converted_1
Original_2 converted_2
Original_3 converted_3
Original_4 converted_4

About

CartoonGAN implementation code with pytorch.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%