Compile OpenCV3 with CUDA on Windows for python
Spec
- i5-4210U
- 8GB RAM
Waht’s Need? / env
- OpenCV
- OpenCV contrib
- Eigen
- CUDA Toolkit 9.0
- Visual Studio 2015 (Microsoft Build Tools 2015 でもいいかもしれない)
- MKL Library
- TBB Library
- Python 3.5
- numpy
Commands
スタートメニューから「VS____ 用 MSBuild のコマンド プロンプト」を開き、Pythonのインタプリンタへのパスが通っていなければ通し、以下もSETしておく。
適宜変更して~。
@rem e.g. “CUDA_HOST_COMPILER=C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe”
SET CUDA_HOST_COMPILER=
@rem -G”Visual Studio 14 2015 Win64″
cmake -B”.” -H”../” -G
MSBuild OpenCV.sln /t:build /p:Configuration=Release;Platform=”x64″
MSBuild INSTALL.vcxproj /t:build /p:Configuration=Release;Platform=”x64″
SET cvDLL=.\x64\
xcopy /f %cvDLL%\opencv_ffmpeg343_64.dll %cvDLL%\opencv_img_hash343.dll %cvDLL%\opencv_world343.dll %PYTHONHOME%\Lib\site-packages\
Result
- Output(13行目)
…514 個の警告
0 エラー
経過時間 01:37:23.58
* Size
About 6GB.
Reference: