开源!适用于Win和Linux平台的YOLO4和YOLO3( 九 )

  • to speedup training (with decreasing detection accuracy) set param stopbackward=1 for layer-136 in cfg-file
  • each: model of object, side, illimination, scale, each 30 grad of the turn and inclination angles - these are different objects from an internal perspective of the neural network. So the more different objects you want to detect, the more complex network model should be used.
  • to make the detected bounded boxes more accurate, you can add 3 parameters ignore_thresh = .9 iou_normalizer=0.5 iou_loss=giou to each [yolo] layer and train, it will increase mAP@0.9, but decrease mAP@0.5.
  • Only if you are an expert in neural detection networks - recalculate anchors for your dataset for width and height from cfg-file: darknet.exe detector calc_anchors data/obj.data -num_of_clusters 9 -width 416 -height 416 then set the same 9 anchors in each of 3 [yolo]-layers in your cfg-file. But you should change indexes of anchors masks= for each [yolo]-layer, so for YOLOv4 the 1st-[yolo]-layer has anchors smaller than 30x30, 2nd smaller than 60x60, 3rd remaining, and vice versa for YOLOv3. Also you should change the filters=(classes + 5)*<number of mask> before each [yolo]-layer. If many of the calculated anchors do not fit under the appropriate layers - then just try using all the default anchors.
    1. After training - for detection:
    • Increase network-resolution by set in your .cfg-file (height=608 and width=608) or (height=832 and width=832) or (any value multiple of 32) - this increases the precision and makes it possible to detect small objects: linkit is not necessary to train the network again, just use .weights-file already trained for 416x416 resolutionbut to get even greater accuracy you should train with higher resolution 608x608 or 832x832, note: if error Out of memory occurs then in .cfg-file you should increase subdivisions=16, 32 or 64: link
    How to mark bounded boxes of objects and create annotation files:Here you can find repository with GUI-software for marking bounded boxes of objects and generating annotation files for Yolo v2 - v4: https://github.com/AlexeyAB/Yolo_mark
    With example of: train.txt, obj.names, obj.data, yolo-obj.cfg, air1-6.txt, bird1-4.txt for 2 classes of objects (air, bird) and train_obj.cmd with example how to train this image-set with Yolo v2 - v4
    Different tools for marking objects in images:
    1. in C++: https://github.com/AlexeyAB/Yolo_mark
    2. in Python: https://github.com/tzutalin/labelImg
    3. in Python: https://github.com/Cartucho/OpenLabeling
    4. in C++: https://www.ccoderun.ca/darkmark/
    5. in JAVAScript: https://github.com/opencv/cvat
    How to use Yolo as DLL and SO libraries
    • on Linuxusing build.sh orbuild darknet using cmake orset LIBSO=1 in the Makefile and do make
    • on Windowsusing build.ps1 orbuild darknet using cmake orcompile builddarknetyolo_cpp_dll.sln solution or builddarknetyolo_cpp_dll_no_gpu.sln solution
    There are 2 APIs:
    • C API: https://github.com/AlexeyAB/darknet/blob/master/include/darknet.hPython examples using the C API::https://github.com/AlexeyAB/darknet/blob/master/darknet.pyhttps://github.com/AlexeyAB/darknet/blob/master/darknet_video.py
    • C++ API: https://github.com/AlexeyAB/darknet/blob/master/include/yolo_v2_class.hppC++ example that uses C++ API: https://github.com/AlexeyAB/darknet/blob/master/src/yolo_console_dll.cpp


    推荐阅读