manuelruder / artistic-videos

Torch implementation for the paper "Artistic style transfer for videos"
Other
1.75k stars 252 forks source link

Trying to build for osx #16

Closed jonasfehr closed 8 years ago

jonasfehr commented 8 years ago

I'm on OS X el capitan and I'm trying to build deepflow2. I simply type 'make'. However I get this error:

gcc -o deepflow2.o -Wall -g -O3 -msse4 -fPIC -c deepflow2.c gcc -o image.o -Wall -g -O3 -msse4 -fPIC -c image.c image.c:20:10: fatal error: 'malloc.h' file not found

include

     ^

1 error generated. make: *\ [image.o] Error 1

jonasfehr commented 8 years ago

I realise it may be very involved trying to get this running on OSX. However if anyone has done it successfully please post here.

ryanfb commented 8 years ago

I've used this Docker image for running this under OS X: teeps/cuda7.5-art-vid

You should be able to use it by running e.g. docker run -t -i teeps/cuda7.5-art-vid /bin/bash, which should pull the image from Docker Hub and drop you into an interactive shell. I don't think there's an easy way of getting GPU acceleration working within Docker on OS X, so you have to use the CPU instead, which is (as warned) incredibly slow.

A better idea might be to run everything up through the makeOptFlow.sh line in stylizeVideo.sh inside the Docker container (so you can use the Linux static binaries for deepmatching/deepflow2), then transfer the resulting files out and run the actual artistic-video.lua torch script on native OS X with GPU acceleration. I haven't tried this yet.

Here are the changes I made to get deepmatching/deepflow2 compiling natively on OS X, however, it would SIGSEGV whenever it would try to read an image and I didn't want to debug further (/usr/local/bin/gcc-6 is provided by the Homebrew gcc package, which supports OpenMP while the native OS X Clang GCC does not): https://gist.github.com/ryanfb/73000ae2b3e59a70747d6088690599ad

vibber commented 8 years ago

Hello it's me again who started this issue - now from the right github account. I have managed to find a workflow as you describe by running the optical-flow process in the Docker container, copying out the files to my OS X environment and continuing the process there. Thank you so much for providing this information and the Docker image.