Not only the object recognition boxes, but also more information (angle, center point)
software | version |
---|---|
CUDA | 10.1 |
CUDNN | 7.6.4 |
OpenCV | 4.2.0 |
VS 2019 | 16.5.0 |
Python | 3.7.4 |
VoTT | 2.1.0 |
reference: Win10 + VS2019 配置Darknet YOLOv3
GPU version, attention:
- installing CUDA , must select vs Compile library
visual_studio_integration
,and copy into vs compilation tools - install cudnn,copy cudnn files into CUDA,or else couldn't find
cudnn.h
- opencv 4.2.0 only have opencv2,but does not affect the use,I use vc14's lib
- open darknet.sln,Prompt to upgrade–Redirect project,stay default.That is to upgrade to match the compilation environment,otherwise it will not compile,because i only installed vs 2019
- vs set up “Maximum number of projects generated in parallel” = 1,otherwise it will not compile
- 【most important】,if you want to use darknet's python version,Also, compile yolo_cpp_dll.dll according to the step-by-step setting of the above compilation darknet tutorial. Then install the missing library via
pip install
,darknet.py
has already exist,don'tpip install
after complication,Download the python code above into .\darknet\build\darknet\x64
- Export Settings -> Provider -> Pascal VOC, Asset State -> Only Tagged Assets
- change xml's path to custom storage folder.
use the script python pascal_voc_to_label.py --data_dir=training\4\4 --imgaugloop=10 --augcheck
to generate darknet format
.
--data_dir #pascal voc directory
--imgaugloop # image augmentation ,default:0,means no augmentation
--augcheck # whether generate check image for augmentation
Eventually contains:
./voc_custom
│ coco_custom.names
│ train.txt
│ tree.txt
│ val.txt
│ voc_custom.data
│ yolov3_custom.cfg
│
├─backup
│ yolov3_custom_1000.weights
│ yolov3_custom_last.weights
│
└─labels
IMG_1544.jpg
IMG_1544.txt
IMG_1544_aug_0.jpg
IMG_1544_aug_0.txt
attention,change yolov3.cfg to yolov3_custom.cfg,config the cfg,then put it into voc_custom
folder
command:
darknet detector train voc_custom\voc_custom.data voc_custom\yolov3_custom.cfg darknet53.conv.74
darknet53.conv.74, need to be downloaded separately
command:
python detect.py --config=voc_custom\yolov3_custom.cfg --weight=voc_custom\backup\yolov3_custom_10000.weights
--meta=voc_custom\voc_custom.data --image=input\IMG_1876.jpg --output=output\IMG_1876_out.jpg
- After augment the images,bbox's postion is not precise enough. It is best to manually annotate the image to enhance the images.
- The recognition angle and size are not accurate enough,Need to improve
cvContours
algorithm.