Code Monkey home page Code Monkey logo

object-aware-cartoonization's Introduction

Anima: Object-Aware Cartoonization

An object-aware cartoonization method using CartoonGAN and Mask R-CNN.

Description

We took inspiration from CartoonGAN which transforms images into Japanese anime style. It generates very pleasing scenery but presents objects too realistically. This is also the same case for a few of the other similar methods. So, we would like to propose an object-aware cartoonization method based on CartoonGAN with Mask R-CNN for object detection.

Installation

  1. Clone this repository

  2. Run setup from the repository root directory

    bash setup.sh
  3. Start Python virtual environment

    source ./venv/bin/activate
  4. Download pre-trained weights inside the root directory from here

Usage

Windowed User Interface

Use UIControl.py to initiate the application. It provides a simple interactive way to input and transform image, as well as visualizing input and output images side by side. However, it does not mirror all the functionalities of the command line interface.

python UIControl.py

Command Line Interface

Use driver.py to perform image cartoonization. By default, it will apply shinkai style transfer with adaptive edge enhancement on images from input directory, the cartoonized images will be placed in output directory.

There are 4 styles available (from CartoonGAN):

  • shinkai
  • hayao
  • hosoda
  • paprika

There are 3 edge enhancement available:

  • adaptive
  • canny
  • morph

There are many customization options available. As an example, the following command specified styles, edges, input image, and output directory:

python driver.py \
  --styles shinkai hayao \
	--edges adaptive canny \
	--input ./input/default.jpg \
	--output_dir ./output

To explore all available customization options, please use the following command to get detailed explainations:

python cartoonize.py --help

Results

For each set of results:

  • The top-left image is the original image
  • The top-right image is the result from CartoonGAN
  • The bottom-left image is the enhanced stroke mask
  • The bottom-right image is the result of our application

donuts-results

police-results

cat-in-bag-results

Acknowledgement

object-aware-cartoonization's People

Contributors

diceyecid avatar

Watchers

 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.