SETUP for FAST-ARTISTIC-VIDEOS on Ubuntu 16.04 / 180923 https://github.com/manuelruder/fast-artistic-videos
-
Follow the artistic-videos setup at: https://gist.github.com/n1ckfg/b7b3edd820f3e0060310322cf3e71d5f
-
Install these luarocks packages:
luarocks install torch
luarocks install nn
luarocks install image
luarocks install lua-cjson
luarocks install cutorch
- You also need these packages, but they should have already been installed for artistic-videos:
luarocks install cudnn
luarocks install cunn
- Compile this local luarocks package:
cd stnbhwd
luarocks make stnbdhw-scm-1.rockspec
- Download the models:
bash models/download_models.sh
-
For optical flow, you can copy over the deepflow binaries from artistic-videos (which are CPU-based and slow).
-
Or you can get flownet (which is GPU-based and fast): https://github.com/lmb-freiburg/flownet2
-
Download flownet's models:
bash models/download-models.sh
-
Copy Makefile.config.example to Makefile.config
-
Make these changes in the makefile: BVLC/caffe#2347
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
USE_CUDNN := 1
- Add these symlinks: BVLC/caffe#4333
cd /usr/lib/x86_64-linux-gnu
sudo ln -s libhdf5_serial.so.10.1.0 libhdf5.so
sudo ln -s libhdf5_serial_hl.so.10.0.2 libhdf5_hl.so
- Return to your flownet directory and compile caffe:
make -j 5 all tools pycaffe
make distribute
- Run the flownet setup script.
source set-env.sh
- install flownet python dependencies.
cd flownet2/distribute/python
sudo pip install -r requirements.txt
- Return to fast-artistic-videos and replace the text in partially-completed run-flownet-multiple.sh
FLOWNET="$HOME/GitHub/ML/flownet2"
export CAFFE_BIN="$FLOWNET/build/tools/caffe.bin"
export PYTHONPATH=$PYTHONPATH:$FLOWNET/distribute/python/
export LD_LIBRARY_PATH=$FLOWNET/distribute/lib:$LD_LIBRARY_PATH
chmod +x "$FLOWNET/scripts/run-flownet-many.py"
"$FLOWNET/scripts/run-flownet-many.py" "$FLOWNET/models/FlowNet2/FlowNet2_weights.caffemodel.h5" "$FLOWNET/models/FlowNet2/FlowNet2_deploy.prototxt.template" $1 --gpu ${2:-0}
- Optional, for stylizing 360 videos, you need Facebook's Transform360 ffmpeg plugin: https://github.com/facebook/transform360 and the VR models:
bash download_models_vr.sh
- Go!