First download Darknet projectgit clone https://github.com/pjreddie/darknet.gitin "darknet/Makefile" put affect 1 to OpenCV, CUDNN and GPU if you # want to train with you GPU then time thos two commandscd darknetmakeLoad convert.py to change labels (xml files) into the appropriate # format that darknet understand and past it under darknet/https://github.com/GuiltyNeuron/ANPRUnzip the datasetunzip dataset.zipCreate two folders, one for the images and the other for labelsmkdir darknet/imagesmkdir darknet/labelsConvert labels format and create files with location of imagesfor the test and the trainingpython convert.pyCreate a folder under darknet/ that will contain your datamkdir darknet/customMove files train.txt and test.txt that contains data path tocustom foldermv train.txt custom/mv test.txt custom/Create file to put licence plate class name "LP"touch darknet/custom/classes.namesecho LP > classes.namesCreate Backup folder to save weightsmkdir custom/weightsCreate a file contains information about data and cfgfiles locationstouch darknet/custom/darknet.datain darknet/custom/darknet.data file paste those informationsclasses = 1train = custom/train.txtvalid = custom/test.txtnames = custom/classes.namesbackup = custom/weights/Copy and paste yolo config file in "darknet/custom"cp darknet/cfg/yolov3.cfg darknet/customOpen yolov3.cfg and change :" filters=(classes + 5)*3" just the ones before "Yolo"in our case classes=1, so filters=18change classes=... to classes=1Download pretrained modelwget https://pjreddie.com/media/files/darknet53.conv.74 -O ~/darknet/darknet53.conv.74Let's train our model !!!!!!!!!!!!!!!!!!!!!$ ./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