# YOLOv5 🚀 by Ultralytics, GPL-3.0 license
# Parameters
nc: 7 # number of classes
depth_multiple: 0.33 # model depth multiple
width_multiple: 0.50 # 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
# YOLOv5 v6.0 backbone
# Conv:步长为2,下采样,大小减半
# C3:学习特征,大小不变
backbone:
# [from, number, module, args]
# 640*640*3
[[-1, 1, Conv, [64, 6, 2, 2]], # 0-P1/2 输出通道数,卷积核大小,步长,padding
# 320*320*32
[-1, 1, Conv, [128, 3, 2]], # 1-P2/4 输出通道数,卷积核大小,步长
# 160*160*64
[-1, 3, C3, [128]], # 输出通道数
# 160*160*64
[-1, 1, Conv, [256, 3, 2]], # 3-P3/8
# 80*80*128
[-1, 6, C3, [256]],
# 80*80*128 -
[-1, 1, Conv, [512, 3, 2]], # 5-P4/16
# 40*40*256
[-1, 9, C3, [512]],
# 40*40*256 -
[-1, 1, Conv, [1024, 3, 2]], # 7-P5/32
# 20*20*512
[-1, 3, C3, [1024]],
# 20*20*512
[-1, 1, SPPF, [1024, 5]], # 9
# 20*20*512
]
# YOLOv5 v6.0 head
# 进行concat的两层必须大小相同、通道数相同
# concat之后通道翻倍
head:
# 20*20*512
[[-1, 1, Conv, [512, 1, 1]], # 步长(第3个)为1!
# 20*20*256 -
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
# 40*40*256
[[-1, 6], 1, Concat, [1]], # cat backbone P4
# 40*40*512
[-1, 3, C3, [512, False]], # 13
# 40*40*256
[-1, 1, Conv, [256, 1, 1]], # 步长(第3个)为1!
# 40*40*128
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
# 80*80*128
[[-1, 4], 1, Concat, [1]], # cat backbone P3
# 80*80*256
[-1, 3, C3, [256, False]], # 17 (P3/8-small)
# 80*80*128
[-1, 1, Conv, [256, 3, 2]],
# 40*40*128
[[-1, 14], 1, Concat, [1]], # cat head P4
# 40*40*256
[-1, 3, C3, [512, False]], # 20 (P4/16-medium)
# 40*40*256
[-1, 1, Conv, [512, 3, 2]],
# 20*20*256
[[-1, 10], 1, Concat, [1]], # cat head P5
# 20*20*512
[-1, 3, C3, [1024, False]], # 23 (P5/32-large)
# 20*20*512
[[17, 20, 23], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
]
【yolov5s.yaml(v6.0) 添加注释】
最新推荐文章于 2023-03-13 14:47:27 发布