为什么yolo无法检测图像中的所有对象? [英] Why yolo can't detect all objects in image?
问题描述
我正在尝试使用AlexeyAB暗网检测图像中的对象,但是它仅检测2或3个对象。它无法检测小对象(例如帽子)。我正在使用以下命令:
I am trying to detect objects in image using AlexeyAB darknet.But it is detecting only 2 or 3 object.It can't detect small objects(for example hat).I am using this command:
./ darknet探测器测试./cfg/coco.data ./cfg/yolov3.cfg / weight_path / / image_path /
我该怎么办?
推荐答案
根据 AlexeyAB页面对于小型对象,您可以执行以下操作:
According to the AlexeyAB page for small objects you can do this:
用于训练小对象(在将图像大小调整为416x416的
之后,小于16x16)-设置图层= -1,11而不是
https://github.com/AlexeyAB/darknet/blob /6390a5a2ab61a0bdf6f1a9a6b4a739c16b36e0d7/cfg/yolov3.cfg#L720
并设置stride = 4而不是
https://github.com/AlexeyAB/darknet/ blob / 6390a5a2ab61a0bdf6f1a9a6b4a739c16b36e0d7 / cfg / yolov3.cfg#L717
要训练小型和大型物体,您可以使用修改后的模型:
For training small and large objects you can use modified models:
- 完整模型:5个yolo层: https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov3_5l.cfg
- 微型模型:3个yolo图层: https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov3-tiny_3l.cfg
- 空间完整模型:3个yolo层:< a href = https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yo lov3-spp.cfg rel = nofollow noreferrer> https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov3-spp.cfg
- 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
另外,在训练完成后,在检测阶段,您可以执行以下操作:
Also after training is done, in the detection phase, you may do the following:
通过在.cfg文件中设置(height = 608和
width = 608)或(height = 832和width = 832)或(任何值倍数)来提高网络分辨率of 32)
-这样可以提高精度,并可以检测小对象:链接
-
不必再次训练网络,只需使用已经针对416x416分辨率进行训练的.weights文件
it is not necessary to train the network again, just use .weights-file already trained for 416x416 resolution
,但是要获得更高的准确性,您应该使用更高分辨率的608x608或832x832进行训练,请注意:如果错误超出发生内存
然后在.cfg-f中则您应该增加细分= 16、32或64:链接
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
这篇关于为什么yolo无法检测图像中的所有对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!