[PYTHON] YOLO v4 environment construction ①

next time YOLO v4 environment construction ②

reference https://youtu.be/5pYh1rFnNZs

system

Windows10 GeForce GTX 960

python installation

Install python 3.7.7 ** Check Add Python 3.7 to PATH **

numpy installation

From the command prompt

$ pip install numpy

Incidentally update pip

$ python -m pip install --upgrade pip

Install Visual Studio Code

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

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

Install CMake 3.17.2

Visual Studio installation

Install Visual Studio 16.5 Community

Check ** python ** and ** Desktop Development ** to install vs_install.jpg

You will be asked to restart ** Restart your PC **

GPU driver update

Download and install the driver in your environment from NVIDIA Official

CUDA installation

Search and download nvidia cuda toolkit Version 10.2 cuda_dl.jpg

Change the installation destination to directly under the C drive cuda_dir.jpg

Then proceed as it is

Download NVIDIA cuDNN

https://developer.nvidia.com/cudnn cudnn.jpg

Create a new account and download ** cuDNN v7.6.5 ** cudnn_dl.jpg

Move the downloaded ** zip file directly under the C drive and unzip it ** to create the `` `cuda``` folder.

Put the unzipped cuDNN related files under CUDA

\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

YOLO v4 environment construction ①
DeepIE3D environment construction
Emacs-based environment construction
Linux environment construction
Python environment construction
Environment construction (python)
django environment construction
CodeIgniter environment construction
python environment construction
Python --Environment construction
Python environment construction
Golang environment construction
python environment construction
Word2vec environment construction
Environment construction: GCP + Docker
Django project environment construction
python windows environment construction
ConoHa environment construction memo
PyData related environment construction
Python development environment construction
pyenv + fish environment construction
python2.7 development environment construction
BigGorilla environment construction memo
grip environment construction onCentOS6.5
Anaconda environment construction memo
Golang environment construction [goenv]
Mac environment construction Python
Pyxel environment construction (Mac)
Python environment construction @ Win7
[Ubuntu 18.04] Tensorflow 2.0.0-GPU environment construction
Python + Anaconda + Pycharm environment construction
About Linux environment construction (CentOS)
PyTorch C ++ (LibTorch) environment construction
Anaconda environment construction on CentOS7
Django development environment construction memo
First LAMP environment construction (Linux)
Python environment construction (Windows10 + Emacs)
CI environment construction ~ Python edition ~
[Memo] Construction of cygwin environment
ML environment construction with Miniconda
Python environment construction For Mac
Anaconda3 python environment construction procedure
Docker + Django + React environment construction
Anaconda3 × Pycharm environment construction memo
Python environment construction and TensorFlow
NumPy and matplotlib environment construction
Machine learning environment construction macbook 2021
Python environment construction under Windows7 environment
[MEMO] [Development environment construction] Python
Ubuntu14.04 + GPU + TensorFlow environment construction
[Tensorflow] Tensorflow environment construction on Windows 10
Environment construction, Build -Go edition-
Run YOLO v3 on AWS v2
django project development environment construction
Linux environment construction (on WSL environment)
Environment construction of python2 & 3 (OSX)
[MEMO] [Development environment construction] wine
Run YOLO v3 on AWS
Ansible environment construction For Mac
DL Laravel environment construction method (Linux)
Mac + Eclipse (PyDev) + Django environment construction