Use this code to execute style transfer tasks as Spell remote runs and download the resulting images.
- If you don't have Python 3 installed then download and run the Anaconda 3 Python 3.7 version installer from https://www.anaconda.com/distribution.
- Create an account at http://spell.run
- Install the Spell command-line interface by running
pip install spell
from the terminal. - Log in to Spell from the terminal by running
spell login
from the terminal. - Download the zip file containg the code for the latest release of this app by visiting https://github.com/ebranda/spell-style-transfer/releases. Extract to a folder in a stable location on your local drive.
This code uses the Neural Style TF method used in the official Spell tutorial (https://learn.spell.run/transferring_style, which uses https://github.com/cysmith/neural-style-tf).
- Prepare your image folders. Create a folder inside
images/style-transfer-images/
. Give this folder a descriptive name and number (e.g.Rome-LA-01
). Inside your new folder, create a new folder calledstyles
and another calledcontent
. Put your style and content images inside these folders. - Repeat step 1 with up to three image folders.
- In the terminal,
cd
to thespell-client
folder you extracted in step 5 above. - Run a Spell command (see below).
Execute commands using the syntax python run.py [command]
.
systemcheck
Checks that your system is up and running and can communicate with Spell.st_upload
Uploads any sets of images currently in yourimages/style-transfer-images/
folder.st_transfer [quality=low|med|high (default=med)]
Runs style transfer on all uploaded image folders (max 3)st_download [runId_1][-[runId_end]]
Downloads the output file from run[runid]
to the local folderimages/results
. You can download the outputs from multiple runs by listing a range of run ids.
Run system check:
python run.py systemcheck
Upload all image folders inside images/style-transfer-images:
python run.py st_upload
Run style transfer on uploaded image folders at medium quality (800 iterations):
python run.py st_transfer
Run style transfer on uploaded image folders at high quality (2000 iterations):
python run.py st_transfer high
Run style transfer on uploaded image folders at low quality (400 iterations):
python run.py st_transfer low
Download the output file from run 54 to the local folder images/results:
python run.py st_download 54
Download the output files from runs 54 through 60 to the local folder images/results:
python run.py st_download 54-60