Skip to content

This is an implementation of CartoonGAN in pytorch, including both ".py" and ".ipynb" version.

Notifications You must be signed in to change notification settings

NeverGiveU/CartoonGAN-pytorch

Repository files navigation

Description

This is an implementation of CartoonGAN. We provide both ".py" and "ipynb" version for tha training. The testing file will be uploaded soon.

Reference

We got greate inspiration from ComixGAN, and we used the implementation from this repository for blurring the comic images.

How to Start?

Firstly, prepare your datasets.

datasets
  ├─comic
  │  ├─001.jpg
  │  ├─002.jpg
  │  ├─...
  │  └─xxx.jpg
  ├─comic_blurred
  └─real
     ├─001.jpg
     ├─002.jpg
     ├─...
     └─xxx.jpg

Secondly, blur the comic images.

python comic_blurring.py

Attention

You need to delete the tmp.txt in the three sub-dir in datasets before you save images in the corresponding directories.

Train

run python train3.py to start training. The Training consists of three parts, which is inspired by ComixGAN, they are

1) Pretrain the Generator to reconstruct the input clear comic images;
2) Pretrain the Discriminator to distinguish images among comic, blurred comic and real images;
** we use LSGAN instead.
3) Adversarially train both the Generator and Discriminator.

Some Results

Note that because of the portraiture right of some real images, we just display the cartoonized results of some data. alt sample_1 alt sample_1 alt sample_1 alt sample_1 alt sample_1 alt sample_1 alt sample_1 alt sample_1

About

This is an implementation of CartoonGAN in pytorch, including both ".py" and ".ipynb" version.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published