赞
踩
鸟巢相信大家都不陌生,这里的鸟巢不是说的是北京鸟巢,而是我们平常司空见惯的鸟儿搭建出来的鸟巢,用于日暮栖息的,很多用电设施或者是大树上面都能看到有很多鸟巢,有些鸟巢的存在对于电力系统设施的安全存在一定的威胁,自动化的检测识别鸟巢及时识别潜在的风险对于保障电力系统设施正常安全运行是很重要的,本文主要就是基于这样的想法来尝试构建目标检测模型来实现对于图像中鸟巢目标的检测识别,首先看下效果图:
接下来看下数据情况:
YOLO格式数据标注文件如下:
实例标注数据内容如下:
0 0.800521 0.126389 0.156771 0.07963
VOC格式标注数据如下:
实例标注数据内容如下:
- <annotation>
- <folder>VOC</folder>
- <filename>4f69f8c6-6377-4ae1-914d-4f4cedde9ddb.jpg</filename>
- <source>
- <database>database</database>
- <annotation>annotation</annotation>
- <image>image</image>
- </source>
- <userinfo>
- <username>夏源</username>
- <date>2019-12-16 18:52:46</date>
- </userinfo>
- <size>
- <width>5184</width>
- <height>3888</height>
- <depth>3</depth>
- </size>
- <segmented>1</segmented>
- <object>
- <name>ganta_02</name>
- <pose>Right</pose>
- <truncated>0</truncated>
- <difficult>0</difficult>
- <bndbox>
- <xmin>3185</xmin>
- <ymin>2727</ymin>
- <xmax>3462</xmax>
- <ymax>2884</ymax>
- </bndbox>
- </object>
- <object>
- <name>ganta_02</name>
- <pose>Right</pose>
- <truncated>0</truncated>
- <difficult>0</difficult>
- <bndbox>
- <xmin>1207</xmin>
- <ymin>1712</ymin>
- <xmax>1368</xmax>
- <ymax>1818</ymax>
- </bndbox>
- </object>
- </annotation>
使用n系列的模型,yaml文件如下:
- #PParameters
- 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
-
- #Bbackbone
- 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次epoch的迭代计算,结果详情如下所示:
混淆矩阵:
LABEL可视化:
PR曲线:
F1值曲线:
batch计算实例如下:
可视化推理效果如下:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。