Skip to content

3_BASICS: Installing and using neural style through a virtual machine

jamahun edited this page Aug 3, 2020 · 5 revisions

The following tutorial will be referencing jcjohnson's neural-style. Follow the link for a more detailed information.

Get neural-style

Use git clone to download the neural-style folder onto your virtual machine

cd ~
git clone https://github.com/jcjohnson/neural-style

Install the models

cd neural-style
sh models/download_models.sh

Basic Usage

Navigate to the neural-style root directory cd ~/neural-style and execute the following command:

th neural_style.lua -style_image <examples/inputs/image.jpg> -content_image <examples/inputs/image.jpg>

Download Style & Content Images

Search for images to use for both style and content and upload them to the /examples/inputs folder. You can use the command wget for this, to do so:

cd examples/inputs
wget -O style_name http://your_url.com
wget -O content_name http://your_url.com

Options

For the full list of options go to https://github.com/jcjohnson/neural-style

High Res Neural Style

Navigate to /examples/multigpu_scripts/starry_stanford.sh and open the file so that you can edit the text

  1. Using Jupyter Lab, edit the .sh file and make the following changes:
STYLE_IMAGE=examples/inputs/<styleName.jpg>
CONTENT_IMAGE=examples/inputs/<contentName.jpg>
  1. Save the .sh file and then execute it by using the command sh starry_stanford.sh