Configuration of yolov3 under windows

yolo official website: https://pjreddie.com/darknet/yolo/

darknet-windows code download: https://github.com/AlexeyAB/darknet (wall cracks are recommended to see the README inside)

Configuration Environment:

 Visual Studio 2015(vc14)

MIRACLES 9.1

cuDNN 7.0

OpenCV 3.4 (other versions correspond to modify the include directory to install the opencv path for yourself)

-----------------------------------------------------------------------------------------------------------------

1. Open build\darknet\darknet.sln with VS, set it to x64 and Release, and then Build->Build darknet. (If this step fails to compile successfully, you can perform the following steps before compiling)

Note: OpenCV used before 3.4.0, 3.4.1 may have problems.

2. Find opencv_world340.dll and opencv_ffmpeg340_64.dll in the opencv installation directory\opencv3.4\opencv\build\x64\vc14\bin (modified according to your own installation path) and copy them to D:\darknet-windows\build\ darknet\x64 (that is, the path where darknet.exe is located).

3. Check C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1 for bin and include folders, if not copy them from the cuda installation path.

4. Install CUDNN (for acceleration, you can not install it)

Download cuDNN 7.0 for CUDA 9.1:  https://developer.nvidia.com/cudnn

After downloading and decompressing, copy the cndnn64_7.dll, cudnn.h, and cudnn.lib in the folder to

C:\ProgramFiles\NVIDIA GPU Computing Toolkit\CUDA\v9.1\bin

C:\ProgramFiles\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include

C:\ProgramFiles\NVIDIA GPU Computing Toolkit\CUDA\v9.1\lib\x64

Note: cudnn needs to correspond to the cuda version.

At this point you should have been configured, if your installation environment is different from mine, please see the following:

-----------------------------------------------------------------------------------------------------------------

1.. If CUDNN is not installed: Open \darknet.sln ->(right click on project) -> properties -> C/C++ -> Preprocessor ->Preprocessor Definitions, and remove this: CUDNN;

2. If your CUDA version is not 9.1: Open build\darknet\darknet.vcxproj and find two places of "CUDA 9.1" and change it to your own version number.

3. If there is no GPU: Open build\darknet\darknet_no_gpu.sln, set x64 and Release, then: Build -> Build darknet_no_gpu

4. If your OpenCV is not 3.4. (Take 2.4.13 as an example)

4.1(right click on project) -> properties -> C/C++ -> General ->Additional Include Directories:             C:\opencv_2.4.13\opencv\build\include

4.2(right click on project) -> properties -> Linker -> General ->Additional Library Directories: C:\opencv_2.4.13\opencv\build\x64\vc14\lib

5.If you haveGPU with Tensor Cores (nVidia Titan V / Tesla V100 / DGX-2 and later) speedupDetection 3x, Training 2x:\darknet.sln -> (right click on project)-> properties -> C/C++ -> Preprocessor -> Preprocessor Definitions,and add here: CUDNN_HALF;

-----------------------------------------------------------------------------------------------------------------

test:

1. Open cmd and switch to the darknet.exe path: D:\darknet-windows\build\darknet\x64

2. Enter in cmd:

darknet_no_gpu.exe detector test data/coco.data yolov3.cfg yolov3.weights(无GPU版)

darknet.exe detector test data/coco.data yolov3.cfg yolov3.weights(GPU版)

yolov3.cfg yolov3.weights要对应,并把它们放在D:\darknet-windows\build\darknet\x64路径下

3.根据提示输入要检测的图像路径。PS:最好把杀毒软件关了,不然darknet.exe会被隔离。

原图:


检测结果:



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325864555&siteId=291194637