为什么yolo检测不到图像中的所有物体?
Why yolo can't detect all objects in image?
我正在尝试使用 AlexeyAB 检测图像中的物体 darknet.But 它仅检测 2 或 3 个 object.It 无法检测小物体(例如帽子)。我正在使用此命令:
./darknet detector test ./cfg/coco.data ./cfg/yolov3.cfg /weight_path/ /image_path/
我该怎么做?
根据AlexeyAB page对于小物体你可以这样做:
for training for small objects (smaller than 16x16 after the image is
resized to 416x416) - set layers = -1, 11 instead of
https://github.com/AlexeyAB/darknet/blob/6390a5a2ab61a0bdf6f1a9a6b4a739c16b36e0d7/cfg/yolov3.cfg#L720
and set stride=4 instead of
https://github.com/AlexeyAB/darknet/blob/6390a5a2ab61a0bdf6f1a9a6b4a739c16b36e0d7/cfg/yolov3.cfg#L717
要训练小型和大型对象,您可以使用修改后的模型:
- Full-model: 5 yolo layers: https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov3_5l.cfg
- Tiny-model: 3 yolo layers: https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov3-tiny_3l.cfg
- Spatial-full-model: 3 yolo layers: https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov3-spp.cfg
同样在训练完成后,在检测阶段,您可以执行以下操作:
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: link
it is not necessary to train the network again, just use .weights-file already trained for 416x416 resolution
but 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
我正在尝试使用 AlexeyAB 检测图像中的物体 darknet.But 它仅检测 2 或 3 个 object.It 无法检测小物体(例如帽子)。我正在使用此命令:
./darknet detector test ./cfg/coco.data ./cfg/yolov3.cfg /weight_path/ /image_path/
我该怎么做?
根据AlexeyAB page对于小物体你可以这样做:
for training for small objects (smaller than 16x16 after the image is resized to 416x416) - set layers = -1, 11 instead of https://github.com/AlexeyAB/darknet/blob/6390a5a2ab61a0bdf6f1a9a6b4a739c16b36e0d7/cfg/yolov3.cfg#L720 and set stride=4 instead of https://github.com/AlexeyAB/darknet/blob/6390a5a2ab61a0bdf6f1a9a6b4a739c16b36e0d7/cfg/yolov3.cfg#L717
要训练小型和大型对象,您可以使用修改后的模型:
- Full-model: 5 yolo layers: https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov3_5l.cfg
- Tiny-model: 3 yolo layers: https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov3-tiny_3l.cfg
- Spatial-full-model: 3 yolo layers: https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov3-spp.cfg
同样在训练完成后,在检测阶段,您可以执行以下操作:
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: link
it is not necessary to train the network again, just use .weights-file already trained for 416x416 resolution
but 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