quickdraw-dataset icon indicating copy to clipboard operation
quickdraw-dataset copied to clipboard

Exporting Drawings as Raw SVG's

Open luismqueral opened this issue 7 years ago • 10 comments

I want to start off by giving tremendous props to the Quick Draw team for releasing this data set to the public. I can't wait to start digging in!

I'm wondering if anyone would be able to provide documentation on how to generating these drawings as individual SVG's. Or even at the very least where I should start looking to be able to do it myself.

Thanks!

luismqueral avatar May 20 '17 20:05 luismqueral

Hi! Not sure if this helps, but I wrote some scripts in this repo that you can use to convert the .npz vector sketches to .svg files, and also display them if you want inside a Jupyter notebook.

You may want to play around with this script, and modify it to batch-process the files the way you want.

hardmaru avatar May 20 '17 21:05 hardmaru

Hey Luis, I've been using d3.js to draw SVG versions of the drawings here: https://bl.ocks.org/enjalot/a2b28f0ed18b891f9fb70910f1b8886d I'm using some node.js scripts and command line tricks to generate subsets of the data for rendering in the browser: parsing the simplified ndjson: https://gist.github.com/enjalot/0ecec46ac5c286379e209c300b341883 parsing the binary format: https://gist.github.com/enjalot/dbd35f7e61ac62fcfc68a2be7ca8d480 here are some tips for processing .ndjson files with ndjson-cli and d3: https://gist.github.com/enjalot/54c4342eb7527ea523884dbfa52d174b

enjalot avatar May 23 '17 00:05 enjalot

Thanks @hardmaru and @enjalot !! I haven't gotten a chance to try your suggestions but it seems like due to the vastness of this set, this is going to be an interesting nut to crack (at least given my limited experience with these kinds of frameworks / filetypes).

My ideal is individual saved out SVG's (with paths intact) for each one of these drawings. I'll report back after I've given your suggestions a try!!

luismqueral avatar May 23 '17 03:05 luismqueral

For anyone else that's stumbling upon this, I'm 100% willing to host these somewhere or perhaps even pay a bounty for a streamlined approach to this 🌞

luismqueral avatar May 23 '17 04:05 luismqueral

I could imagine a modified version of my node script that uses d3 and jsdom to automatically convert ndjson into svg files. It would still take a long time and result in 50 million svg files. another approach could be rendering the svg on demand and offering to save, depending on what you want to accomplish with those svg files.

On Mon, May 22, 2017 at 9:00 PM, luis queral [email protected] wrote:

For anyone else that's stumbling upon this, I'm 100% willing to host these somewhere or perhaps even pay a bounty for a streamlined approach to this 🌞

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googlecreativelab/quickdraw-dataset/issues/3#issuecomment-303284397, or mute the thread https://github.com/notifications/unsubscribe-auth/AAF3vTtzZ12o_czsLAd4YCl23am09Ponks5r8lnxgaJpZM4NhaJm .

-- Ian Johnson - 周彦 http://enjalot.github.io/ http://enja.org

enjalot avatar May 23 '17 04:05 enjalot

It would still take a long time and result in 50 million svg files.

Heh, the scale of this project is absurd, thanks for putting it in perspective.

In an effort to making the output of this project more accessible, perhaps we could just export a large amount from each category, if not every single image? I'm imagining something like 2-5k per category. So a lot of images, but certainly not enough to warrant the entire database. I'll experiment with that when I can.

@enjalot @hardmaru How much time should I expect to need per image export do you think?

luismqueral avatar May 23 '17 19:05 luismqueral

Hello @luismqueral do you still need this feature? :)

kennethassogba avatar Nov 05 '18 00:11 kennethassogba

@kenn44 Very much so!

I know a lot of people would be interested in an accessible way to extract individual SVG's from this dataset :-).

luismqueral avatar Nov 05 '18 01:11 luismqueral

I'm working on it. Give me few days :)

kennethassogba avatar Nov 05 '18 02:11 kennethassogba

I've been using this. It creates a lot of svg images, but they're compact.

https://pypi.org/project/ndjsonTosvg/

thompson318 avatar May 12 '20 19:05 thompson318