• Stars
    star
    453
  • Rank 94,317 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 7 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

an u-net with some algorithm to take sketch from paints

sketchKeras

An u-net with some algorithm to take the sketch from a painting.

requirement

  • Keras
  • Opencv
  • tensorflow/theano
  • numpy

download mod

see release

performance

Currently there are many edge-detecting algrithoms or nerual networks. But few of them has good performance on paintings, espatially those from comic or animate. Most of these existing methods just detect the edge and then add lines to the edge. However, we need a method to convert the painting to a sketch which looks like a painter drawed the outline of picture. It is important when we want to train a nerual networks to colorlize pictures.(Paper is on the way)

Here is a example of artificial sketch for reference.

goal

Here is a conclusion of existing methods to handle this problem.

  • use opencv and implement a high-pass effect to get the edge
  • train a nerual network (HED Edge Detect)/(PaintsChainer's lnet)
  • use this sketchKeras which combined algorithm and nerual networks

Take this pic as an example (Picture is from internet and I am finding the author.)

pic

If we use the high-pass algorithm via opencv or something else, we may get this one:

pic

As we can see, the result is far from artificial sketch. To achieve better performance, we may modify the parameters and enhance the pic, then it comes this one:

pic

The result is still not good. People like to add shadow to their drawing by add dense lines or points and these will become noise and disturb the high-pass algorithm. It is apprent that we can modify the parameters or use denoise methods to improve it, but drawings differ from one another and it is impossible to handle these automatically.

Then let us try the lnet of PaintsChainer (similar to HED)

pic

The result from nerual networks looks different from those from algorithm. However, this is still not so good. The author of PaintsChainer use threslod to avoid noise and normalize the line, as this:

pic

In this picture, we can see clearly that the noise, espeacilly near eyes and in the shadow of hair. "threslod" can filter some noise but some useful lines is also dropped. Last but not least, the lines are too coarse and thick. Here is a reference of thresloded artificial sketch:

pic

As we can see, though the picture is denoised by "threslod", it differs far from real artificial sketch. So it remains much improvement place in paintsChainer.

Finally, let us see the result of sketchKeras:

pic

pic

pic

pic

The four results are generated by sketchKeras. You can use your favorite one to generate your own training dataset for colorize networks.


another example

(picture is from internet and I am finding the author.) raw picture:

pic

opencv and high-pass (all detail and noise remained so it is not suitable for training a colorize network)

pic

opencv and high-pass enhanced (still not so good and we can see the pic is going to become a grayscaled detailed pic but not a sketch)

pic

paintsChainer's lnet (all detail and noise remained, espcially the hair)

pic

paintsChainer's lnet (thresloded) (just look at the hair)

pic

Pics below are generated by sketchKeras. It can drop some noise and unimportant detail to achieve better performance.

pic

pic

pic

ability to generate colored highlighted sketch

As you can see, sketchKeras has the ability to generate colored highlighted sketch.

pic

More Repositories

1

Fooocus

Focus on prompting and generating
Python
36,200
star
2

ControlNet

Let us control diffusion models!
Python
28,205
star
3

style2paints

sketch + style = paints 🎨 (TOG2018/SIGGRAPH2018ASIA)
JavaScript
17,795
star
4

stable-diffusion-webui-forge

Python
5,203
star
5

ControlNet-v1-1-nightly

Nightly release of ControlNet 1.1
Python
4,439
star
6

IC-Light

More relighting!
Python
3,142
star
7

PaintingLight

Generating Digital Painting Lighting Effects via RGB-space Geometry (SIGGRAPH2020/TOG2020)
Python
713
star
8

MangaCraft

This project has been abandoned.
707
star
9

DanbooRegion

DanbooRegion: An Illustration Region Dataset (ECCV 2020)
Python
376
star
10

YGOProUnity_V2

A sample version of ygopro in Unity
C#
308
star
11

AdverseCleaner

Remove adversarial noise from images
Python
297
star
12

AppearanceEraser

Erasing Appearance Preservation in Optimization-based Smoothing (ECCV 2020)
C++
176
star
13

ToonDecompose

A project to decompose the components in cartoon animations.
Python
114
star
14

SingleFileDB

A single file implementation of key-value database for Python 3.
Python
46
star
15

MangaFilter

"Generating Manga from Illustrations via Mimicking Manga Creation Workflow" in CVPR 2021
HTML
44
star
16

Style2PaintsResearch

Style2Paints Research Website
HTML
27
star
17

SplitFilling

"User-Guided Line Art Flat Filling with Split Filling Mechanism" in CVPR 2021
HTML
26
star
18

White-box-Cartoonization

Official tensorflow implementation for CVPR2020 paper “Learning to Cartoonize Using White-box Cartoon Representations”
Python
24
star
19

lllyasviel.github.io

lllyasviel.github.io
13
star
20

GitPageToonDecompose

GitHub Page of ToonDecompose
HTML
5
star
21

lllyasviel

lllyasviel
5
star
22

misc_files

Misc files.
3
star
23

misc

Misc files.
2
star