• Stars
    star
    215
  • Rank 183,265 (Top 4 %)
  • Language
    Python
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

optional extra vector image datasets for sketch-rnn

Simple Vector Drawing Datasets

This repo contains a set of optional, extra datasets for training sketch-rnn, a generative model for vector drawings. You can learn more about the model by reading this blog post or the paper. An open-source TensorFlow implementation of sketch-rnn is available here. Although the datasets had been created in the format customized for training sketch-rnn, it can, and should be used for training newer and better models to advance the state of generative vector image modelling.

We have organized 3 datasets in this repo:

Stroke-3 Vector Format

In each dataset, each sample is stored as list of coordinate offsets: βˆ†x, βˆ†y, and a binary value representing whether the pen is lifted away from the paper. This format, we refer to as stroke-3, is described in Alex Graves' paper on sequence generation. Note that the data format described in the sketch-rnn paper has 5 elements (stroke-5 format), and we need to perform live conversion of the data to the stroke-5 format during mini-batch construction.

Example Training Sketche

We show a single example to illustrate this data format in the figure above. This below-average turtle drawing is sketched by the author. The turtle is represented as a sequence of (βˆ†x, βˆ†y, binary pen state) points. In the rendered form, the line color corresponds to the sequential stroke ordering to illustrate the ordering.

Each dataset is stored as a python list of examples. Each example is represented as a np.array with np.int16 datatype, and can be easily loaded using the following commands in a Jupyter notebook:

filename = "sketch-rnn-datasets/kanji/short_kanji.npz"
load_data = np.load(filename)
train_set = load_data['train']
valid_set = load_data['valid']
test_set = load_data['test']

print len(train_set)
  Output: 10000
print len(valid_set)
  Output: 600
print len(test_set)
  Output: 500
  
# draw a random example (see draw_strokes.py)
draw_strokes(random.choice(train_set))

For some of the datasets, we also performed simple stroke simplification to preprocess the data, using the Ramer-Douglas-Peucker (RDP) algorithm. We choose the epsilon parameter to be a value between 1.0 to 3.0, depending on how aggressively we want to simply the lines.

If you have a large set of simple SVG images, and want to construct a similar dataset, there are some available libraries to convert subsets of SVGs into line segments. You can then apply RDP on the line segments before converting the data to stroke-3 format. There is some easy-to-use open source code for applying this algorithm here.

License

Please check the license and copyright information for each dataset in their respective directories.

More Repositories

1

estool

Evolution Strategies Tool
Jupyter Notebook
901
star
2

sketch-rnn

Multilayer LSTM and Mixture Density Network for modelling path-level SVG Vector Graphics data in TensorFlow
Python
793
star
3

write-rnn-tensorflow

Generative Handwriting using LSTM Mixture Density Network with TensorFlow
Python
692
star
4

slimevolleygym

A simple OpenAI Gym environment for single and multi-agent reinforcement learning
Python
633
star
5

WorldModelsExperiments

World Models Experiments
Jupyter Notebook
545
star
6

pytorch_notebooks

tutorial notebooks
Jupyter Notebook
371
star
7

cppn-gan-vae-tensorflow

Train CPPNs as a Generative Model, using Generative Adversarial Networks and Variational Autoencoder techniques to produce high resolution images.
Python
346
star
8

cppn-tensorflow

Very Simple and Basic Implementation of Compositional Pattern Producing Network in TensorFlow
Python
311
star
9

neuralslimevolley

Neural Slime Volleyball
JavaScript
201
star
10

supercell

supercell
Jupyter Notebook
188
star
11

rnn-tutorial

RNN Tutorial for Artists
JavaScript
183
star
12

resnet-cppn-gan-tensorflow

Using Residual Generative Adversarial Networks and Variational Auto-encoder techniques to produce high resolution images.
Python
123
star
13

backprop-neat-js

Neural Network Evolution Playground with Backprop NEAT
JavaScript
122
star
14

astool

Augmented environments with RL
Jupyter Notebook
102
star
15

image-notebook

image-notebook
Jupyter Notebook
87
star
16

gecco-tutorial-2019

2019 talk at GECCO
67
star
17

neurogram

neurogram
JavaScript
64
star
18

mdn_jax_tutorial

Mixture Density Networks (Bishop, 1994) tutorial in JAX
Jupyter Notebook
56
star
19

presentations

presentations
44
star
20

cppn-gan-vae-cifar-tensorflow

First attempt to use the previous CPPN-GAN-VAE model to train on CIFAR-10 images.
Python
39
star
21

netart-js

quick hacked together js demo to implement fixed-topology cppn in the web browser for interactive usage
JavaScript
39
star
22

sketch-rnn-flowchart

trained sketch-rnn / deployed with sketch-rnn-js on flowchart dataset
JavaScript
33
star
23

kanji2kanji

Reproduce domain transfer results in Deep Learning for Classical Japanese Literature
Jupyter Notebook
31
star
24

paperjs_box2d

demo of working with box2d and paper.js
JavaScript
31
star
25

RainbowSlimeVolley

Using Rainbow implementation in Chainer RL for Slime Volleyball Pixel Environment
Python
24
star
26

sketch-rnn-poster

Poster for "A Neural Representation for Sketch Drawings" for ICLR 2018 Conference
22
star
27

rlzoo

fork of rl-baseline-zoo
Python
21
star
28

quickdraw-ndjson-to-npz

Convert RAW Quickdraw datafiles into stroke-based .npz format with RDP at variable epsilon for sketch-rnn
Jupyter Notebook
15
star
29

sema-demo

sketch-rnn demo for seoul mediacity biennale 2018
JavaScript
13
star
30

diff-vae-tensorflow

skeleton variation encoder code in tensorflow
Python
12
star
31

pybullet_animations

pybullet_animations
12
star
32

cma

Fork of cma-es library by Nikolaus Hansen
Python
11
star
33

cantonese-list

List of 4000 Chinese characters sorted by historical usage frequency, with Cantonese yale romanization and definition
11
star
34

creatures

autonomous creatures written in processing / processing.js
Processing
7
star
35

zombie

A* search algorithm example, zombie chasing humans
Python
4
star
36

tshirtai

3
star
37

batchnorm-convnet-mnist-tensorflow

self contained skeleton script for testing and training mnist convnet+batchnorm based classifier in tensorflow
Python
2
star
38

chainerrl

ChainerRL is a deep reinforcement learning library built on top of Chainer.
Python
2
star