All Projects → DwangoMediaVillage → Comicolorization

DwangoMediaVillage / Comicolorization

Licence: mit
This is the implementation of the "Comicolorization: Semi-automatic Manga Colorization"

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Comicolorization

Coloring Greyscale Images
Coloring black and white images with deep learning.
Stars: ✭ 767 (+674.75%)
Mutual labels:  colorization
Cgp Cnn
A Genetic Programming Approach to Designing CNN Architectures, In GECCO 2017 (oral presentation, Best Paper Award)
Stars: ✭ 59 (-40.4%)
Mutual labels:  chainer
Seranet
Super Resolution of picture images using deep learning
Stars: ✭ 79 (-20.2%)
Mutual labels:  chainer
Chainerrl
ChainerRL is a deep reinforcement learning library built on top of Chainer.
Stars: ✭ 931 (+840.4%)
Mutual labels:  chainer
Rdoc
colourised R docs in the terminal
Stars: ✭ 49 (-50.51%)
Mutual labels:  colorization
Chainer Ssd
Implementation of SSD (Single Shot MultiBox Detector) using Chainer
Stars: ✭ 66 (-33.33%)
Mutual labels:  chainer
Deepo
Setup and customize deep learning environment in seconds.
Stars: ✭ 6,145 (+6107.07%)
Mutual labels:  chainer
Chainer Handson
CAUTION: This is not maintained anymore. Visit https://github.com/chainer-community/chainer-colab-notebook/
Stars: ✭ 84 (-15.15%)
Mutual labels:  chainer
Wavenet
WaveNet implementation with chainer
Stars: ✭ 53 (-46.46%)
Mutual labels:  chainer
Chainer Vq Vae
A Chainer implementation of VQ-VAE.
Stars: ✭ 77 (-22.22%)
Mutual labels:  chainer
Resnet Multipleframework
ResNet benchmark by Keras(TensorFlow), Keras(MXNet), Chainer, PyTorch using Google Colab
Stars: ✭ 14 (-85.86%)
Mutual labels:  chainer
Chainer Segnet
SegNet implementation & experiments in Chainer
Stars: ✭ 42 (-57.58%)
Mutual labels:  chainer
Ansi Econsole
Eclipse plugin that understands ANSI escape sequences to color the Eclipse console output.
Stars: ✭ 72 (-27.27%)
Mutual labels:  colorization
Chainer Rnn Ner
Named Entity Recognition with RNN, implemented by Chainer
Stars: ✭ 19 (-80.81%)
Mutual labels:  chainer
Spacenet building detection
Project to train/test convolutional neural networks to extract buildings from SpaceNet satellite imageries.
Stars: ✭ 83 (-16.16%)
Mutual labels:  chainer
Machine Learning Curriculum
💻 Make machines learn so that you don't have to struggle to program them; The ultimate list
Stars: ✭ 761 (+668.69%)
Mutual labels:  chainer
Neuralstyler
Turn Your Videos/photos/Gif into Art
Stars: ✭ 61 (-38.38%)
Mutual labels:  chainer
Wasserstein Gan
Chainer implementation of Wasserstein GAN
Stars: ✭ 95 (-4.04%)
Mutual labels:  chainer
Onnx Chainer
Add-on package for ONNX format support in Chainer
Stars: ✭ 83 (-16.16%)
Mutual labels:  chainer
Chainer Pspnet
PSPNet in Chainer
Stars: ✭ 76 (-23.23%)
Mutual labels:  chainer

Comicolorization

This is an implementation of the Comicolorization : Semi-automatic Manga Colorization.

With this repository, you can

  • run sample codes
  • train colorization task
  • use as colorization library

Sample Code

We prepare two sample codes, sample_painting.py and sample_detecting_panels.py.

  1. sample_painting.py is example of colorization the manga page.
  2. sample_detecting_panels.py is example of detection auto panel rectangle.

First of all, install the requirements.

pip install -r requirements.txt

In addition, you must install OpenCV-Python.

Colorization

python sample/sample_painting.py

# Help
# python sample/sample_painting.py --help

Auto Panel Rectangle Detection

1. get manga-frame-extension and build

git submodule init
git submodule update
cd manga-frame-extraction/MangaFrameExtraction
cmake ./
make

Please read manga-frame-extraction's README.md for details.

2. run

cd ../../
python sample/sample_detecting_panels.py

# Help
# python sample/sample_detecting_panels.py --help

Copyright

Following images are from Manga109 dataset.

©Ishioka Shoei ©Sakurano Minene ©Sakurano Minene ©Tanaka Masato

Training

There are two training task.

  1. the colorization task for generate the low resolution colorized image.
  2. the super resolution task for generate the higher resolution colorized image.

First of all, install the requirements.

pip install -r requirements.txt

In addition, you must install OpenCV-Python.

Colorization Task

1. prepare dataset

For training, three type data are required.

  • color images that Pillow can load
  • json file written label ID list that has 'id' key
    • ex. { "id": [ "a", "b", "c" ] }
  • json file written label ID list for each image
    • the key is image file name without extension
    • ex. { "imageX": ["a", "b"], "imageY": ["a"], "imageZ": ["c"], ... }

2. run

# run same as paper
python bin/train.py \
    /path/to/images/directory \
    /path/to/save \
    --path_tag_list /path/to/label_ID_list.json \
    --path_tag_list_each_image /path/to/label_ID_list_for_each_image.json \
    --network_model LTBC \
    --num_dataset_test 1000 \
    --batchsize 30 \
    --size_image 224 \
    --augmentation True \
    --size_image_augmentation 256 \
    --save_result_iteration 1000 \
    --random_seed_test 0 \
    --loss_type Lab \
    --alpha_ltbc_classification 0.00333333333 \
    --ltbc_classification_loss_function multi_label \
    --line_drawing_mode otsu_threshold \
    --max_pixel_drawing 15 \
    --use_adversarial_network \
    --blend_adversarial_generator 1.0 \
    --discriminator_first_pooling_size 2 \
    --optimizer_adam_alpha 0.0001 \
    --blend_mse_color 1.0 \
    --mse_loss_mode color_space \
    --weight_decay 0.0001 \
    --log_interval 200 \
    --gpu -1 \
    --ltbc_classification_num_output_list 512 428 \  # last number should be same as number of labels
    {color_feature}  # other params depending on task, please see below

# Help
# python bin/train.py --help

When palette mode, change color_feature to

    --threshold_histogram_palette 0.0 \
    --use_histogram_network \
    --num_bins_histogram 6 \
    --use_multidimensional_histogram

When histogram mode, change color_feature to

    --use_histogram_network \
    --num_bins_histogram 6 \
    --use_multidimensional_histogram

When without any color feature, color_feature is empty.

Super Resolution Task

1. modify config file

Modify the information with these keys in bin/config_super_resolution.json.

  • dataset/images_glob: set the image file names
  • model/other/path_result_directory: set the colorization model directory
  • project/name: set the name of this task (this will be the directory name)
  • project/result_path: set the path for the result directory

2. run

python bin/train_super_resolution.py bin/config_super_resolution.json

Use as colorization library

Install

pip install git+http://github.com/DwangoMediaVillage/Comicolorization

Download trained model

Please download model files at model directory in this repository.

How to use

  1. import comicolorization and comicolorization_sr
  2. initialize Drawer
  3. load model
  4. initialize PagePipeline
  5. call process method

Please see the sample code for more details.

License

MIT License, see LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].