Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Neural Style Transfer
# Ubuntu:14.04 - 64 bits
# MINIMUM IS 8GB OF RAM.
curl -sk https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; ./install.sh
. ~/.bashrc # or: . ~/.zshrc
luarocks install nn
luarocks install nngraph
luarocks install image
sudo apt-get -y install libprotobuf-dev protobuf-compiler
luarocks install loadcaffe
sudo apt-get -y install libhdf5-dev hdf5-tools python-dev python-pip
pip install cython numpy h5py
luarocks install hdf5
cd /home
git clone https://github.com/jcjohnson/neural-style.git
cd neural-style
luarocks install FindCUDA
luarocks install cunn
luarocks install cutorch
sh models/download_models.sh
# gpu 0 or 1
th neural_style.lua -style_image examples/inputs/picasso_selfport1907.jpg -content_image examples/inputs/brad_pitt.jpg -output_image profile.png -model_file models/VGG_ILSVRC_19_layers.caffemodel -proto_file models/VGG_ILSVRC_19_layers_deploy.prototxt -gpu -1 -num_iterations 1000 -seed 123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.