• Stars
    star
    453
  • Rank 96,573 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated over 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
40,542
star
2

ControlNet

Let us control diffusion models!
Python
29,314
star
3

style2paints

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

Omost

Your image is almost there!
Python
7,046
star
5

stable-diffusion-webui-forge

Python
5,639
star
6

ControlNet-v1-1-nightly

Nightly release of ControlNet 1.1
Python
4,635
star
7

IC-Light

More relighting!
Python
4,561
star
8

sd-forge-layerdiffuse

[WIP] Layer Diffusion for WebUI (via Forge)
Python
3,720
star
9

Paints-UNDO

Understand Human Behavior to Align True Needs
Python
3,119
star
10

LayerDiffuse

Transparent Image Layer Diffusion using Latent Transparency
1,943
star
11

PaintingLight

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

MangaCraft

This project has been abandoned.
708
star
13

DanbooRegion

DanbooRegion: An Illustration Region Dataset (ECCV 2020)
Python
384
star
14

YGOProUnity_V2

A sample version of ygopro in Unity
C#
314
star
15

AdverseCleaner

Remove adversarial noise from images
Python
297
star
16

LayerDiffuse_DiffusersCLI

LayerDiffuse in pure diffusers without any GUI
Python
280
star
17

AppearanceEraser

Erasing Appearance Preservation in Optimization-based Smoothing (ECCV 2020)
C++
182
star
18

ToonDecompose

A project to decompose the components in cartoon animations.
Python
116
star
19

SingleFileDB

A single file implementation of key-value database for Python 3.
Python
50
star
20

MangaFilter

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

Style2PaintsResearch

Style2Paints Research Website
HTML
27
star
22

SplitFilling

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

huggingface_guess

A simple tool to guess an HuggingFace repo URL from a state dict.
Python
23
star
24

lllyasviel.github.io

lllyasviel.github.io
15
star
25

lllyasviel

lllyasviel
8
star
26

GitPageToonDecompose

GitHub Page of ToonDecompose
HTML
5
star
27

forge-legacy-extensions

some archived legacy forge extensions
Python
5
star
28

misc_files

Misc files.
3
star
29

misc

Misc files.
2
star
30

Discussion

2
star
31

pages

some github pages
JavaScript
2
star
32

google_blockly_prototypes

1
star