Extracting dense flow field given a video.
- LibZip:
to install on ubuntu
apt-get install libzip-dev
on macbrew install libzip
Please see the opencv-3.1 branch. Many thanks to @victorhcm for the contributions!
git clone --recursive http://github.com/yjxiong/dense_flow
mkdir build && cd build
# `export OpenCV_DIR=/path/to/opencv-2.4.13/release/` if necessary
cmake -D CUDA_USE_STATIC_CUDA_RUNTIME=OFF ..
make -j
-
Error: cannot find -lopencv_dep_cudart
solution: add -D CUDA_USE_STATIC_CUDA_RUNTIME=OFF when build dense_flowcmake -D CUDA_USE_STATIC_CUDA_RUNTIME=OFF ..
-
Can't find right OpenCV version and path
Export opencv build path(containing the OpenCVConfig.cmake file) beforemake ..
export OpenCV_DIR=/path/to/opencv-2.4.13/release/
-
Boost python version problem
ImportError: /dense_flow/build/libpydenseflow.so: undefined symbol: _ZN5boost6python6detail11init_moduleER11PyModuleDefPFvvE
Solution: Modify line 23 of CMakeLists.txt to FIND_PACKAGE(PythonLibs 2.7 REQUIRED). The default one is for Python3.5m
./extract_gpu -f test.avi -x tmp/flow_x -y tmp/flow_y -i tmp/image -b 20 -t 1 -d 0 -s 1 -o dir
test.avi
: input videotmp
: folder containing RGB images and optical flow imagesdir
: output generated images to folder. if set tozip
, will write images to zip files instead.
The warp optical flow is used in the following paper
@inproceedings{TSN2016ECCV,
author = {Limin Wang and
Yuanjun Xiong and
Zhe Wang and
Yu Qiao and
Dahua Lin and
Xiaoou Tang and
Luc {Van Gool}},
title = {Temporal Segment Networks: Towards Good Practices for Deep Action Recognition},
booktitle = {ECCV},
year = {2016},
}
To extract warp flow, use the command
./extract_warp_gpu -f test.avi -x tmp/flow_x -y tmp/flow_y -i tmp/image -b 20 -t 1 -d 0 -s 1 -o dir