Building Flowty¶
Flowty depends on OpenCV and FFmpeg. To build flowty outside of docker you will need to build and install these things yourself. This is surprisingly challenging given the finicky nature of OpenCV builds. It is also necessary to build OpenCV with CUDA support.
Your best bet for manually setting up an environment to run flowty is to look at the Dockerfile we build upon: willprice/opencv4. This is built on Ubuntu 18.04 (although very few changes are needed to go back to 16.04). You can see the flags we enable for building OpenCV. The key flags are:
OPENCV_GENERATE_PKGCONFIG=onas we usepkgconfiginsetup.pyto get the OpenCV paths.WITH_FFMPEG=onsince FFmpeg is the default backendWITH_CUDA=onas some of the algorithms are CUDA acceleratedOPENCV_EXTRA_MODULES_PATH=<path/to/opencv_contrib/modules>since theoptflowmodule isn’t in core OpenCV.
Pay close attention to the output of cmake as the configuration step won’t
crash if FFmpeg isn’t found, this will result in an OpenCV build incapable of
reading videos (upon attempting to read a video it will just return no frames
rather than raising an exception).
Resources¶
Check out the following