bobbens / sketch_simplification

Models and code related to sketch simplification of rough sketches.
https://esslab.jp/~ess/research/sketch_master/
Other
726 stars 103 forks source link

How to use with your own sketches? #4

Open b-adkins opened 6 years ago

b-adkins commented 6 years ago

Hi! I was interested in this library as a user, not a developer. I hate inking my comics and wanted an AI inker. I could run the included example data with no issue, but the application failed on my own drawings.

What does it take to run my own scanned pencil drawing through your neural net? Is there preprocessing required? Are there specific details that need to be correct in an image file? What range of resolutions does it accept? E.g. a human heads of height 30px to 700px.

bobbens commented 6 years ago

It should run fine on your input, assuming it is an image type supported by pillow. Preprocessing is done by the script. Image size is a bit tricky, as it influences the output, I usually run between 500-1500 pixel lengths, but it really depends on how detailed the image is.

jakubLangr commented 6 years ago

Thanks for the model, it looks really awesome!

But I have a bit to add to this:

Yet this is the ouput I get (looks nothing like the original image) diag

Any recommendations?

Ps, if you need any extra information to help diagnose it, just ask. Happy to chat :)

jakubLangr commented 6 years ago

Alright, I've managed to get output with the mse model.

A couple of extra thoughts.

This file was originally .jpg, wonder if that has anything to do with it?

bobbens commented 6 years ago

@jakubLangr Could I see the input image? I'm assuming the network is firing on the paper texture and the contrast is very low which could explain those results.

jakubLangr commented 6 years ago

Yes, probably the case. So how did you obtain the training dataset? it does not look like it's scanned but i would never get the light so perfect.

For example this image produced similar results: diagram2

jakubLangr commented 6 years ago

diagram Or this one

bobbens commented 6 years ago

The models were not trained with data taken from pictures, which explains the low performance on the images you supplied. Retraining with data more similar to the images you want to use with would work better (training code is available now). Our new approach should be able to handle that much better, however, I still have to prepare the code and models to make them public.

jakubLangr commented 6 years ago

Hi sure, no problem. Thanks for you response and let me know when the models are public!

pá 29. 6. 2018 v 1:30 odesílatel Edgar Simo-Serra notifications@github.com napsal:

The models were not trained with data taken from pictures, which explains the low performance on the images you supplied. Retraining with data more similar to the images you want to use with would work better (training code is available now). Our new approach should be able to handle that much better, however, I still have to prepare the code and models to make them public.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bobbens/sketch_simplification/issues/4#issuecomment-401212486, or mute the thread https://github.com/notifications/unsubscribe-auth/ABy_ZHkfMlm-kqUGBfMTstUbLcyOIym2ks5uBXUXgaJpZM4SJbBr .

-- Jakub Langr Mobile (UK): +44 7511 624 004 Mobile (CZ): +420 731 088 879 Mobile (US): +1 650 338 8807 See my blog at jakublangr.com http://goo.gl/Zbq4t3!

raul1968 commented 5 years ago

Could you post the code that you use? I get two errors when trying to run. $ python simplify.py Traceback (most recent call last): File "simplify.py", line 4, in from torch.utils.serialization import load_lua ImportError: No module named serialization and unable to load_lua.. I even put ubuntu 16.04 to try and get it to work. I have several hundred images of my own i want to use to train it but can wrap my mind around how to get it to work. I'm trying to use it for my animation to clean up my pencils since I don't use very much color.