dense_flow在cuda10的安装

安装dense_flow 我使用的是opencv3.2安装步骤类似,参考:https://github.com/open-mmlab/mmaction/issues/9

0. (For CUDA 10.0 only) CUDA 9.x should have no problem.   cuda10的同志们这里注意了!!!
Video decoder is deprecated in CUDA 10.0. To handle this, download NVIDIA VIDEO CODEC SDK and copy the header files to your cuda path (/usr/local/cuda-10.0/include/ for example). Note that you may have to do as root.

unzip Video_Codec_SDK_9.0.20.zip
cp Video_Codec_SDK_9.0.20/include/nvcuvid.h /usr/local/cuda-10.0/include/
cp Video_Codec_SDK_9.0.20/include/cuviddec.h /usr/local/cuda-10.0/include/


1. Install OpenCV 4.1.0
Note that I didn't come across any other prerequisites for installation. If any, please kindly remind me to add in the comment.
(a) Obtain the OpenCV 4.1.0 and its extra modules (optflow. etc.) by

# assume you are now in the directory of /PATH/TO/MMACTION/third_party/
wget -O OpenCV-4.1.0.zip wget https://github.com/opencv/opencv/archive/4.1.0.zip 
unzip OpenCV-4.1.0.zip
wget -O OpenCV_contrib-4.1.0.zip https://github.com/opencv/opencv_contrib/archive/4.1.0.zip
unzip OpenCV_contrib-4.1.0.zip


(b) Install OpenCV 4.1.0 by

cd opencv-4.1.0
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_CUDA=ON -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.1.0/modules/ -DWITH_TBB=ON -DBUILD_opencv_cnn_3dobj=OFF -DBUILD_opencv_dnn=OFF -DBUILD_opencv_dnn_modern=OFF -DBUILD_opencv_dnns_easily_fooled=OFF ..
make -j
Note that remember to explicitly setting -DOPENCV_ENABLE_NONFREE=ON if you want to enable warped_flow (warped flow is proposed in TSN).

2. Install dense_flow

cd ../../dense_flow
# git checkout opencv-4.1.0
# don't need switch to the branch for opencv-4.1.0
# it has been merged to master branch (Fix on 27/06/2019)
mkdir build && cd build
OpenCV_DIR=../../opencv-4.1.0/build/  cmake ..
make -j
where OpenCV_DIR specifies the OpenCV that we are using, which will be helpful if there are various opencvs on your machine.

Here the structure looks like

├── third_party
│   ├── decord
│   ├── opencv-4.1.0
│   ├── opencv_contrib-4.1.0
│   ├── dense_flow

你可能感兴趣的:(环境搭建)