First download Darknet project
clone https://github.com/pjreddie/darknet.git git
in "darknet/Makefile" put affect 1 to OpenCV, CUDNN and GPU if you # want to train with you GPU then time thos two commands
cd darknet
make
# format that darknet understand and past it under darknet/ Load convert.py to change labels (xml files) into the appropriate
https://github.com/GuiltyNeuron/ANPR
Unzip the dataset
unzip dataset.zip
for the images and the other for labels Create two folders, one
mkdir darknet/images
mkdir darknet/labels
Convert labels format and create files with location of images
for the test and the training
python convert.py
Create a folder under darknet/ that will contain your data
mkdir darknet/custom
Move files train.txt and test.txt that contains data path to
custom folder
mv train.txt custom/
mv test.txt custom/
"LP" Create file to put licence plate class name
touch darknet/custom/classes.names
echo LP > classes.names
Create Backup folder to save weights
mkdir custom/weights
Create a file contains information about data and cfg
files locations
touch darknet/custom/darknet.data
in darknet/custom/darknet.data file paste those informations
classes = 1
train = custom/train.txt
valid = custom/test.txt
names = custom/classes.names
backup = custom/weights/
in "darknet/custom" Copy and paste yolo config file
cp darknet/cfg/yolov3.cfg darknet/custom
Open yolov3.cfg and change :
" filters=(classes + 5)*3" just the ones before "Yolo"
in our case classes=1, so filters=18
change classes=... to classes=1
Download pretrained model
wget https://pjreddie.com/media/files/darknet53.conv.74 -O ~/darknet/darknet53.conv.74
's train our model !!!!!!!!!!!!!!!!!!!!! Let
$ ./darknet detector train custom/darknet.data custom/yolov3.cfg darknet53.conv.74
python object-detection_yolo.py --image= image.jpg
分享
点收藏
点点赞
点在看
文章转发自AI科技大本营微信公众号,版权归其所有。文章内容不代表本站立场和任何投资暗示。
Copyright © 2021.Company 元宇宙YITB.COM All rights reserved.元宇宙YITB.COM