Giter Site home page Giter Site logo

mukosame / anime2sketch Goto Github PK

View Code? Open in Web Editor NEW
1.9K 1.9K 161.0 17.25 MB

A sketch extractor for anime/illustration.

License: MIT License

Python 96.60% Dockerfile 2.00% Makefile 1.39%
anime comic computer-vision deep-learning gan gans generative-adversarial-network gradio image-generation manga pytorch sketch wacv

anime2sketch's People

Contributors

fulltear avatar kitoriaaa avatar mukosame avatar re-n-y avatar virtualramblas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anime2sketch's Issues

ValueError: Unknown resampling filter

When I run test.py, I get a ValueError: Unknown resampling filter (InterpolationMode.BICUBIC) error in data.py.
To avoid errors
data.py line 96 image_pil = image_pil.resize (output_resize, bic) is
image_pil = image_pil.resize (output_resize, Image.BICUBIC) or
Shouldn't image_pil = image_pil.resize (output_resize, 3)?
This way the error no longer occurs.

enhancement : add a dockerfile

could be useful to have a dockerfile that contains all the programs needed to run it. We could just mount a volume for the input/output.

Artifact-free version of model

Overview

Right now, this model has issues in dark / low contrast regions #21. I've made a version of the model which significantly reduces the artifacts of this model without degrading performance on existing images.
Below are a couple of examples model outputs

Normal image

Image

image

Original

image

Improved

image

Dark image

Image

image

Original

image

Improved

image

Of course, the model outputs aren't perfect... but if the author of the repository or anyone is interested. Would be glad to write a PR or share methods, weights and code.

Error when using Gradio

Hello, just like the title said. I can't perform Anime2Sketch using the Gradio demo website and I got an error.

image

And I can't use the demo image from the website.

image

I don't know it is a bug or just my internet because I already try to delete the cookies and I still have that trouble.

Thank you

ValueError: Unknown resampling filter error

I'm using Windows 10 and python 3.9

PS C:\Users\Tamal\Desktop\Anime2Sketch> python3 test.py --dataroot image --load_size 512 --output_dir results
Traceback (most recent call last):
File "C:\Users\Tamal\Desktop\Anime2Sketch\test.py", line 46, in
save_image(aus_img, aus_path, aus_resize)
File "C:\Users\Tamal\Desktop\Anime2Sketch\data.py", line 96, in save_image
image_pil = image_pil.resize(output_resize, bic)
File "C:\Users\Tamal\AppData\Local\Programs\Python\Python39\lib\site-packages\PIL\Image.py", line 1957, in resize
raise ValueError(
ValueError: Unknown resampling filter (InterpolationMode.BICUBIC). Use Image.NEAREST (0), Image.LANCZOS (1), Image.BILINEAR (2), Image.BICUBIC (3), Image.BOX (4) or Image.HAMMING (5)
PS C:\Users\Tamal\Desktop\Anime2Sketch>

line extraction but with colored lines

Hi, thanks to great works.

tho found this project has been stalled for a year

can it do line extraction but with colored lines (mark) , train model on multi-colour lines pairs ?

In fact, in animation production, called 色トレス, need work that tracing the scanned paper drawing into digital

the tracing easy to coloring (compare to illustration making), tracing following coloring reference to standardize lines colour, like solid line, shadow, highlight mark

How can we make it work on normal images?

Hi, I would like to convert normal face images to sketch. Would a model trained on ffhq dataset perform well with normal images? Have you tried something like this before?

how to train for my own dataset

Hi, thanks for your sharing , I want to train my own dataset using this network

I see in readme for training in AODA, but AODA repo also has nothing about how to train 。。。

User Warning

I am getting the following error while trying the test code.

UserWarning: Argument interpolation should be of type InterpolationMode instead of int. Please, use InterpolationMode enum.
warnings.warn(

Artifacts in result sketch

Hi

Thanks for your great work.

When I test on my own dataset, sometimes it will show some artifacts in darkness place.
Do you have any good suggestions to fix it?
artifact

ValueError: Expected more than 1 spatial element when training, got input size torch.Size([1, 512, 1, 1])

raise ValueError("Expected more than 1 spatial element when training, got input size {}".format(size))
ValueError: Expected more than 1 spatial element when training, got input size torch.Size([1, 512, 1, 1])

analytics-python 1.4.0
backoff 1.10.0
bcrypt 3.2.0
certifi 2021.10.8
cffi 1.15.0
charset-normalizer 2.0.8
click 8.0.3
colorama 0.4.4
cryptography 36.0.0
cycler 0.11.0
ffmpy 0.3.0
Flask 2.0.2
Flask-CacheBuster 1.0.0
Flask-Cors 3.0.10
Flask-Login 0.5.0
fonttools 4.28.2
gradio 2.4.6
idna 3.3
itsdangerous 2.0.1
Jinja2 3.0.3
kiwisolver 1.3.2
markdown2 2.4.1
MarkupSafe 2.0.1
matplotlib 3.5.0
monotonic 1.6
numpy 1.21.4
packaging 21.3
pandas 1.3.4
paramiko 2.8.1
pep517 0.12.0
Pillow 8.4.0
pip 21.3.1
pycparser 2.21
pycryptodome 3.11.0
pydub 0.25.1
PyNaCl 1.4.0
pyparsing 3.0.6
python-dateutil 2.8.2
pytz 2021.3
requests 2.26.0
setuptools 41.2.0
setuptools-scm 6.3.2
six 1.16.0
tomli 1.2.2
torch 1.10.0
torchtext 0.11.0
torchvision 0.11.1
tqdm 4.62.3
typing_extensions 4.0.0
urllib3 1.26.7
Werkzeug 2.0.2

可以使用这个模型用来训练普通图片到草图吗?

你好,可以使用这个模型用来训练普通图片到草图吗?我使用AODA进行了一些尝试,但是效果并不理想,我猜可能是我哪里做错了。
这是我的训练参数,希望能得到你的帮助,谢谢!

python train.py --dataroot ./dataset/sketch/ --name scribble_aoda  --model aoda_gan  --gan_mode vanilla --no_dropout --n_classes 9 --direction BtoA --save_epoch_freq 1 --load_size 260 --continue_train --gpu_ids 0 

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.