• Stars
    star
    262
  • Rank 156,136 (Top 4 %)
  • Language
    Jupyter Notebook
  • License
    Creative Commons ...
  • Created over 5 years ago
  • Updated almost 2 years ago

Reviews

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

Repository Details

Neural Painters: A learned differentiable constraint for generating brushstroke paintings

https://arxiv.org/abs/1904.08410

Abstract

We explore neural painters, a generative model for brushstrokes learned from a real non-differentiable and non-deterministic painting program. We show that when training an agent to "paint" images using brushstrokes, using a differentiable neural painter leads to much faster convergence. We propose a method for encouraging this agent to follow human-like strokes when reconstructing digits. We also explore the use of a neural painter as a differentiable image parameterization. By directly optimizing brushstrokes to activate neurons in a pre-trained convolutional network, we can directly visualize ImageNet categories and generate "ideal" paintings of each class. Finally, we present a new concept called intrinsic style transfer. By minimizing only the content loss from neural style transfer, we allow the artistic medium, in this case, brushstrokes, to naturally dictate the resulting style.

banner

Notebooks

NOTE: THERE ARE NEWER AND MORE READABLE NOTEBOOKS + A LIBRARY AVAILABLE AT https://github.com/reiinakano/neural-painters-pytorch

There are runnable notebooks for the paper in the notebooks/ folder.

To completely reproduce the paper from scratch, there is technically a logical order in which to run these notebooks.

However, since most people will probably only be interested in certain parts of the paper, we have designed them so you will be able to run each part as standalone notebooks. For example, we have provided pre-trained neural painters so you can run the style transfer notebook without having to train your own neural painter.

Note on code quality - I will be the first to tell you that the code quality of these notebooks is not production-level. If you have any questions or trouble understanding the code, please feel free to open an issue and ask.

Notebook descriptions

  • generate_stroke_examples.ipynb - This notebook contains code to generate pre-calculated mappings from action space to brushstroke image. If you don't want to run this, you can always just use the ones we uploaded to Kaggle.

  • train_vae_painter.ipynb and train_gan_painter.ipynb - These notebooks contain code to train VAE and GAN neural painters, respectively. Requires the output from generate_stroke_examples.ipynb.

vae gan

  • recreating_spiral.ipynb - Contains code for the "Recreating SPIRAL Results" section in the paper. Requires a neural painter. We provide pre-trained neural painters if you don't want to train your own.

spiral

  • learning_human_strokes.ipynb - Contains code for the "Towards Learning Human Strokes" section of the paper. Requires a neural painter. We provide pre-trained neural painters if you don't want to train your own.

  • visualizing_imagenet_classes.ipynb - Contains code for the "Visualizing ImageNet Classes" subsection of the paper. Requires a neural painter. We provide pre-trained neural painters if you don't want to train your own.

visualize_imagenet

  • intrinsic_style_transfer.ipynb - Contains code for the "Intrinsic Style Transfer" subsection of the paper. Requires a neural painter. We provide pre-trained neural painters if you don't want to train your own.

intrinsic

More Repositories

1

scikit-plot

An intuitive library to add plotting functionality to scikit-learn objects.
Python
2,401
star
2

fast-style-transfer-deeplearnjs

Demo of in-browser Fast Neural Style Transfer with deeplearn.js library
TypeScript
1,352
star
3

xcessiv

A web-based application for quick, scalable, and automated hyperparameter tuning and stacked ensembling in Python.
Python
1,266
star
4

arbitrary-image-stylization-tfjs

Arbitrary style transfer using TensorFlow.js
JavaScript
1,184
star
5

gan-playground

GAN Playground - Experiment with Generative Adversarial Nets in your browser. An introduction to GANs.
TypeScript
347
star
6

neural-painters-pytorch

PyTorch library for "Neural Painters: A learned differentiable constraint for generating brushstroke paintings"
Jupyter Notebook
139
star
7

invariant-risk-minimization

Implementation of Invariant Risk Minimization https://arxiv.org/abs/1907.02893
Jupyter Notebook
84
star
8

tfjs-lstm-text-generation

Generate your own Nietschze quote using TensorFlow.js
JavaScript
15
star
9

tfjs-rock-paper-scissors

Play Rock Paper Scissors with your webcam using TensorFlow.js
JavaScript
14
star
10

adversarially-robust-neural-style-transfer

Jupyter Notebook
8
star
11

gnuradio-go

Python
6
star
12

tfjs-autoencoder

A denoising autoencoder written in TensorFlow.js
HTML
6
star
13

pix2pix-runway

Python
5
star
14

my-resume

Here be my resume.
5
star
15

wifisniffer

Automatically decrypts and displays WiFi packets captured from the air. This is unfinished and no longer maintained.
Python
3
star
16

post--robust-neural-style

JavaScript
1
star
17

msk-cancer

Repository for storing some of my notebooks for Kaggle's competition https://www.kaggle.com/c/msk-redefining-cancer-treatment/
Jupyter Notebook
1
star
18

KDD-2010-mini-project

Just a messy filedump of all my ipython notebooks for "competing" in the KDD 2010 Cup Challenge
Jupyter Notebook
1
star
19

personal_exercises

Short scripts I write for practicing software engineering interviews
Python
1
star