next time YOLO v4 environment construction ②
reference https://youtu.be/5pYh1rFnNZs
Windows10 GeForce GTX 960
Install python 3.7.7
** Check Add Python 3.7 to PATH
**
From the command prompt
$ pip install numpy
$ python -m pip install --upgrade pip
I want to make Visual Studio Code the default editor for Git, so install it first. The version is 1.45.1 No need for someone else with an editor
Install Git 2.26.2 There is a screen to select the default editor, so select VS Code (default is Vim) Then proceed as it is OK
Install CMake 3.17.2
Install Visual Studio 16.5 Community
Check ** python ** and ** Desktop Development ** to install
You will be asked to restart ** Restart your PC **
Download and install the driver in your environment from NVIDIA Official
Search and download nvidia cuda toolkit Version 10.2
Change the installation destination to directly under the C drive
Then proceed as it is
https://developer.nvidia.com/cudnn
Create a new account and download ** cuDNN v7.6.5 **
Move the downloaded ** zip file directly under the C drive and unzip it ** to create the `` `cuda``` folder.
\cuda\In bin**cudnn64_7.dll**Copy
#### **`\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\Paste to bin`**
```c
Similarly
#### **`\cuda\In include**cudnn.h**Copy`**
```c
#### **`\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\Paste to include`**
```c
#### **`\cuda\lib\on x64**cudnn.lib**Copy`**
```c
#### **`\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\lib\Paste to x64`**
```c
# OpenCV installation
## Clone opencv and opencv_contrib from GitHub
Create and move the ```opencv``` directory directly under the C drive
git clone https://github.com/opencv/opencv git clone https://github.com/opencv/opencv_contrib
Create a ``` build``` directory in the same directory
![opencv_build.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/644808/c7fddfac-f7d5-bc06-f32e-7125eb16ca81.jpeg)
# CMake settings and build
Start CMake and set the source code and build destination to `` `C: / opencv / opencv``` and `` `C: / opencv / build``` respectively
![cmake.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/644808/de0bddd6-0afe-5342-9526-7fc0c0d80f64.jpeg)
Press ** Configure ** button to set generator and platform to `` `Visual Studio 16 2019` `` and `` `x64```
![cmakeconfig.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/644808/43987403-e498-12a2-9a15-0d28df1b65fa.jpeg)
Check `` `BUILD_opencv_world` `` in the list
![build_cvworld.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/644808/a9f0d836-4810-8864-c255-a51d755c2826.jpeg)
Make sure there are no errors and press ** Generate **
# Build OpenCV in Visual Studio
Open ** ALL_BUILD.vcxproj ** in the build folder ``` C: \ opencv \ build``` and start Visual Studio
Change to Release mode and build ```ALL_BUILD``` and ```INSTALL``` from the right-click menu respectively
![vsbuild.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/644808/59dda162-71a7-beb2-42bd-3589da413636.jpeg)
## Check the operation at the command prompt
Start the python interpreter at the command prompt and check that openCV works
$ python
import cv2 cv2.version '4.3.0-dev'
# Continue to next time
[YOLO v4 environment construction ②](https://qiita.com/kzsDev/items/85d117195f44a86dd8fe)
Recommended Posts