This repository contains environments described in the ICML'18
paper "Synthesizing Programs for Images using Reinforced Adversarial Learning".
For the time being, the authors of the paper are providing two simulators:
one based on libmypaint
and one
based on Fluid Paint
(NOTE: the authors'
implementation is written in C++
whereas the original is in javascript
).
If you feel an immediate urge to dive into the code the most relevant files are:
Path | Description |
---|---|
spiral-envs/spiral/envs/libmypaint.py |
The libmypaint -based environment |
spiral-envs/spiral/envs/fluid.py |
The Fluid Paint -based environment |
This section describes how to build and install the package on Ubuntu (16.04 or newer). The following instructions (with slight modifications) might also work for other Linux distributions.
Clone this repository and fetch the external submodules:
git clone https://github.com/urw7rs/spiral-envs.git
cd spiral-envs
git submodule update --init --recursive
Install required packages:
apt-get install cmake pkg-config protobuf-compiler libjson-c-dev intltool libpython3-dev python3-pip
pip3 install six setuptools numpy scipy
WARNING: Make sure that you have cmake
3.14 or later since we rely
on its capability to find numpy
libraries. If your package manager doesn't
provide it follow the installation instructions from
here. You can check the version by
running cmake --version
.
Finally, run the following command to install the SPIRAL package itself:
python3 setup.py develop --user
You will also need to obtain the brush files for the libmypaint
environment
to work properly. These can be found
here. For example, you can
place them in third_party
folder like this:
wget -c https://github.com/mypaint/mypaint-brushes/archive/v1.3.0.tar.gz -O - | tar -xz -C third_party
Finally, the Fluid Paint
environment depends on the shaders from the original
javascript
implementation. You can obtain
them by running the following commands:
git clone https://github.com/dli/paint third_party/paint
patch third_party/paint/shaders/setbristles.frag third_party/paint-setbristles.patch
For a basic example of how to use the package see original repo