赞
踩
在一些特殊场景诸如:环保、湿地公园、电力设施等,鸟类是一个很大的安全隐患,有效地监测到鸟类并及时预警驱逐对于安全正常地生产进行有着重要的作用。这里主要是基于前文的基础上开发构建的轻量级的鸟类检测系统,首先看下效果:
接下来看下数据集:
YOLO格式标注文件如下:
实例标注内容如下所示:
0 0.51875 0.501389 0.579167 0.863889
VOC格式标注文件如下所示:
实例标注内容如下所示:
- <annotation>
- <folder>DDDD</folder>
- <filename>00c25dd7-03f3-4cc8-bc82-c5d21088df21.jpg</filename>
- <source>
- <database>The DDDD Database</database>
- <annotation>DDDD</annotation>
- <image>DDDD</image>
- </source>
- <owner>
- <name>YSHC</name>
- </owner>
- <size>
- <width>361</width>
- <height>500</height>
- <depth>3</depth>
- </size>
- <segmented>0</segmented>
-
- <object>
- <name>Carolina_Wren</name>
- <pose>Unspecified</pose>
- <truncated>0</truncated>
- <difficult>0</difficult>
- <bndbox>
- <xmin>114</xmin>
- <ymin>102</ymin>
- <xmax>250</xmax>
- <ymax>222</ymax>
- </bndbox>
- </object>
-
- </annotation>
这里因为是单类别的检测,且整体数据集观察发现,数据是比较清晰直观的,所以直接采用了YOLOv5最轻量的n系列的模型,如下:
- #Parameters
- nc: 1 # number of classes
- depth_multiple: 0.33 # model depth multiple
- width_multiple: 0.25 # layer channel multiple
- anchors:
- - [10,13, 16,30, 33,23] # P3/8
- - [30,61, 62,45, 59,119] # P4/16
- - [116,90, 156,198, 373,326] # P5/32
-
- #Backbone
- backbone:
- # [from, number, module, args]
- [[-1, 1, Conv, [64, 6, 2, 2]], # 0-P1/2
- [-1, 1, Conv, [128, 3, 2]], # 1-P2/4
- [-1, 3, C3, [128]],
- [-1, 1, Conv, [256, 3, 2]], # 3-P3/8
- [-1, 6, C3, [256]],
- [-1, 1, Conv, [512, 3, 2]], # 5-P4/16
- [-1, 9, C3, [512]],
- [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32
- [-1, 3, C3, [1024]],
- [-1, 1, SPPF, [1024, 5]], # 9
- ]
-
- #Head
- head:
- [[-1, 1, Conv, [512, 1, 1]],
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
- [[-1, 6], 1, Concat, [1]], # cat backbone P4
- [-1, 3, C3, [512, False]], # 13
-
- [-1, 1, Conv, [256, 1, 1]],
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
- [[-1, 4], 1, Concat, [1]], # cat backbone P3
- [-1, 3, C3, [256, False]], # 17 (P3/8-small)
-
- [-1, 1, Conv, [256, 3, 2]],
- [[-1, 14], 1, Concat, [1]], # cat head P4
- [-1, 3, C3, [512, False]], # 20 (P4/16-medium)
-
- [-1, 1, Conv, [512, 3, 2]],
- [[-1, 10], 1, Concat, [1]], # cat head P5
- [-1, 3, C3, [1024, False]], # 23 (P5/32-large)
-
- [[17, 20, 23], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
- ]
默认执行100次的迭代计算,如下:
混淆矩阵:
F1曲线:
LABEL可视化:
PR曲线:
batch计算实例:
可以看到:检测识别的效果是非常不错的,而且置信度都很高。
可视化推理样例如下:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。