googlecreativelab / quickdraw-dataset

Documentation on how to access and use the Quick, Draw! Dataset.
https://quickdraw.withgoogle.com/data
Other
6.14k stars 936 forks source link

Exporting Drawings as Raw SVG's #3

Open luismqueral opened 7 years ago

luismqueral commented 7 years ago

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!

hardmaru commented 7 years ago

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.

enjalot commented 7 years ago

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

luismqueral commented 7 years ago

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 commented 7 years ago

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 🌞

enjalot commented 7 years ago

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 notifications@github.com 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

luismqueral commented 7 years ago

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?

kennethassogba commented 5 years ago

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

luismqueral commented 5 years ago

@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 :-).

kennethassogba commented 5 years ago

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

thompson318 commented 4 years ago

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

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