YOLOv3 on window10

動作環境

CUDA10 cuDNN OpenCV3.4.0 darknet YOLOv3

Windows10
VisualStudio2017

install CUDA 10
install cuDNN

install OpenCV(3.4.0)
donwload pre-build 3.4.0
https://sourceforge.net/projects/opencvlibrary/files/opencv-win/
https://docs.opencv.org/3.4.0/d3/d52/tutorial_windows_install.html#tutorial_windows_install_path

darknet

add system variable.
OPENCV_PATH D:\OpenCV\Build\x64\vc15

ここからダウンロードする。
https://github.com/AlexeyAB/darknet
darknet.slnを開き、プロジェクトのプロパティを設定する。

c/c++ > add header folder
D:\opencv\opencv-3.4.0\opencv\build\include

c/c++ > Linker > add library folder
D:\opencv\opencv-3.4.0\opencv\build\x64\vc15\lib

CUDA C/C++
CUDA Toolkit Custom Dir
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0
D:\opencv\opencv-3.4.0\opencv\build\include

copy files.

folder構成

D:\darknet\build\darknet\x64\
darknet.exe
opencv_world340.dll # copy from opencv
opencv_ffmpeg340_64.dll # copy from opencv
cudnn64_7.dll # copy from cuDNN
D:\darknet\build\darknet\x64\card\
card.data
classes.txt
darknet53.conv.74 #Pre-trained file
test.txt
train.txt
yolov3.cfg
D:\darknet\build\darknet\x64\card\img\
IMG1.jpg
IMG2.jpg
IMG3.jpg
IMG1.txt
IMG2.txt
IMG3.txt
# annotation file (labaeImage.pyでバウンディングボックスに囲む)

D:\darknet\build\darknet\x64\card\backup
card-yolov3_last.weights

card.data

classes = 1
train = card/train.txt
valid = card/test.txt
names = card/classes.txt
backup = card/backup

test.txt/train.txt

card/img/IMG_0828.jpg
card/img/IMG_0840.jpg
card/img/IMG_0829.jpg
card/img/IMG_0841.jpg

画像ファイルを20%、80%にわける(spsplitTrainAndTest.py(imgfoler))

classes.txt(cardという種別一種類のとき)

card

Run

darknet.exe detector train card/card.data card/yolov3.cfg darknet53.conv.74

Annotationfile

Leave a Reply