Giter Club home page Giter Club logo

cartoongan's Introduction

CartoonGAN

update 2020.06.01:

Our paper "Learning to Cartoonize Using White-Box Cartoon Representations" is accepted by CVPR2020. Source code and pre-trained model is open-sourced in https://github.com/SystemErrorWang/White-box-Cartoonization.

update 2019.08.08 upload a new script and npy weight, now you can cartoonize image with random size.

update 2019.07.18 Upload some results of my new model. It's much better than before. A pre-trained model is also available now, please feel free to try your own data. The training settings are quite different from the original pape now. Maybe i will write a paper about it

update 2019.09.16 Added some result of my new model, writing papers now.

demo video is available on bilibili: https://www.bilibili.com/video/av56708333#reply1789899604

some new results:

alt text alt text alt text alt text alt text alt text alt text alt text alt text

update 2019.06.18: I designed a new model, trained it with new dataset and got much better cartoonization quality Still, you can find old scripts in 'old_code' folder, and run training script with description below.

alt text alt text alt text

This is a tensorflow implementation of Cartoon GAN published in CVPR2018 (http://openaccess.thecvf.com/content_cvpr_2018/papers/Chen_CartoonGAN_Generative_Adversarial_CVPR_2018_paper.pdf). The network is loosely based on the paper but has a few changes: input size is 96(256 in original paper), patch size for discriminator is 28(70 in original paper), less channels and stacked residual blocks for generator and discriminator network, different hyperparameters.

In this implementation, we use celeba dataset for real person images and getchu dataset (https://github.com/shaform/GirlsManifold) for cartoon style images. All images were center cropped into square shape and then resized to 96. For the edge-blured images, I simply applied gaussian blur with kernel size 5 for convenience. You also need to download a pre-trained vgg19 model and locate in in the save folder. (https://mega.nz/#!xZ8glS6J!MAnE91ND_WyfZ_8mvkuSa2YcA7q-1ehfSm-Q1fxOvvs)

This code is based on Tensorflow 1.8, Python 3.6, and was tested in both windows10 and ubuntu16. You can run the code simply by typing "python main.py", and change the settings using argparse. The test function is still under construction, but I believe this code is easy to read, and it will not be difficult to implement it yourself.

Here are results after 20000, 40000, 60000, 80000 and 100000 iterstions. The results are not very satisfying, and front hair is a serious problem. I will go ong trying to fine-tuning this model (and train with scenery dataset.)

alt text

Result after 20000 iterations

alt text

Result after 40000 iterations

alt text

Result after 60000 iterations

alt text

Result after 80000 iterations

alt text

Result after 100000 iterations

I also added some test results here:

alt text

alt text

alt text

cartoongan's People

Contributors

systemerrorwang avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.