Text to abstract art generation for the holidays!
christmAIs ("krees-ma-ees") is text-to-abstract art generation for the holidays!
This work converts any input string into an abstract art by:
This results to images that look like these:
Please see requirements.txt
and requirements-dev.txt
for all Python-related
dependencies. Notable dependencies include:
The build steps (what we're using to do automated builds in the cloud) can be seen in the Dockerfile. For local development, it is recommended to setup a virtual environment. To do that, simply run the following commands:
git clone [email protected]:thinkingmachines/christmAIs.git
cd christmAIs
make venv
We created an automated install script to perform a one-click setup in your workspace. To run the script, execute the following command:
source venv/bin/activate # Highly recommended
./install-christmais.sh
This will first install magenta
and its dependencies, download file
dependencies (categories.txt
, model.ckpt
, and chromedriver
), then clone
and install this package.
For manual installation, please follow the instructions below:
The style transfer capabilities are dependent on the magenta package. As of now, magenta is only supported in Linux and Mac OS. To install magenta, you can perform the automated install or do the following steps:
# Install OS dependencies
apt-get update && \
apt-get install -y build-essential libasound2-dev libjack-dev
# Install magenta
venv/bin/pip install magenta
You can then install the remaining dependencies in requirements.txt
. Assuming
that you have create a virtual environment via make venv
, we recommend that
you simply run the following command:
make build # or `make dev`
This will also download (via wget
) the following files:
./categories/categories.txt
)../ckpt/model.ckpt
)../webdriver/chromedriver
).Ensure that you have all dev dependencies installed:
git clone [email protected]:thinkingmachines/christmAIs.git
make venv
make dev
Then to build the actual docs
cd christmAIs/docs/
make html
This will generate an index.html
file that you can view in your browser.
We have provided a script, christmais_time.py
to easily generate your stylized Quick, Draw! images.
In order to use it, simply run the following command:
python -m christmais.tasks.christmais_time \
--input=<Input string to draw from> \
--style=<Path to style image> \
--output=<Unique name of output file> \
--model-path=<Path to model.ckpt> \
--categories-path=<Path to categories.txt> \
--webdriver-path=<Path to webdriver>
If you followed the setup instructions above, then the default values for the
paths should suffice, you only need to supply --input
, --style
, and
--output
.
As an example, let's say I want to use the string Thinking Machines
as our
basis with the style of Ang Kiukok's
Fishermen
(ang_kiukok.jpg
), then, my command will look like this:
python -m christmais.tasks.christmais_time \
--input="Thinking Machines" \
--style=./path/to/ang_kiukok.png \
--output=tmds-output
This will then generate the output image in ./artifacts/
:
sketch-rnn.js
):https://github.com/hardmaru/magenta-demos/tree/master/sketch-rnn-js