当前位置:网站首页>【yolov5.yaml解析】
【yolov5.yaml解析】
2022-07-05 11:34:00 【网络星空(luoc)】

可以先从yolov5s.yaml中可以看到每一层的结构
# parameters
nc: 20 # number of classes
depth_multiple: 0.33 # model depth multiple 控制模型的深度(BottleneckCSP个数)
width_multiple: 0.50 # layer channel multiple 控制Conv通道channel个数(卷积核数量)
# depth_multiple表示BottleneckCSP模块的缩放因子,将所有BottleneckCSP模块的Bottleneck乘上该参数得到最终个数。
# width_multiple表示卷积通道的缩放因子,就是将配置里面的backbone和head部分有关Conv通道的设置,全部乘以该系数。
# 通过这两个参数就可以实现不同复杂度的模型设计。
# anchors
anchors:
- [10,13, 16,30, 33,23] # P3/8 wh stride=8
- [30,61, 62,45, 59,119] # P4/16
- [116,90, 156,198, 373,326] # P5/32
# YOLOv5 backbone
backbone:
# [from, number, module, args]
# from表示当前模块的输入来自那一层的输出,-1表示来自上一层的输出
# number表示本模块重复的次数,1表示只有一个,3表示重复3次
# module: 模块名
# args:
[[-1, 1, Focus, [64, 3]], # 0-P1/2
[-1, 1, Conv, [128, 3, 2]], # 1-P2/4 128个3x3的卷积核 stride=2
[-1, 3, C3, [128]], # CSP Bottleneck with 3 convolutions
[-1, 1, Conv, [256, 3, 2]], # 3-P3/8
[-1, 9, 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, 1, SPP, [1024, [5, 9, 13]]],
[-1, 3, C3, [1024, False]], # 9
]
# YOLOv5 head
# 作者没有区分neck模块,所以head部分包含了PANet+Detect部分
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)
]
或者使用命名输出:
YOLOv5 2021-6-29 torch 1.7.0+cpu CPU
from n params module arguments
0 -1 1 3520 models.common.Focus [3, 32, 3]
1 -1 1 18560 models.common.Conv [32, 64, 3, 2]
2 -1 1 18816 models.common.C3 [64, 64, 1]
3 -1 1 73984 models.common.Conv [64, 128, 3, 2]
4 -1 1 156928 models.common.C3 [128, 128, 3]
5 -1 1 295424 models.common.Conv [128, 256, 3, 2]
6 -1 1 625152 models.common.C3 [256, 256, 3]
7 -1 1 1180672 models.common.Conv [256, 512, 3, 2]
8 -1 1 656896 models.common.SPP [512, 512, [5, 9, 13]]
9 -1 1 1182720 models.common.C3 [512, 512, 1, False]
10 -1 1 131584 models.common.Conv [512, 256, 1, 1]
11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
12 [-1, 6] 1 0 models.common.Concat [1]
13 -1 1 361984 models.common.C3 [512, 256, 1, False]
14 -1 1 33024 models.common.Conv [256, 128, 1, 1]
15 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
16 [-1, 4] 1 0 models.common.Concat [1]
17 -1 1 90880 models.common.C3 [256, 128, 1, False]
18 -1 1 147712 models.common.Conv [128, 128, 3, 2]
19 [-1, 14] 1 0 models.common.Concat [1]
20 -1 1 296448 models.common.C3 [256, 256, 1, False]
21 -1 1 590336 models.common.Conv [256, 256, 3, 2]
22 [-1, 10] 1 0 models.common.Concat [1]
23 -1 1 1182720 models.common.C3 [512, 512, 1, False]
24 [17, 20, 23] 1 67425 Detect [20, [[10, 13, 16, 30, 33, 23], [30, 61, 62, 45, 59, 119], [116, 90, 156, 198, 373, 326]], [128, 256, 512]]
Model Summary: 283 layers, 7114785 parameters, 7114785 gradients, 16.5 GFLOPs
边栏推荐
- pytorch训练进程被中断了
- Advanced technology management - what is the physical, mental and mental strength of managers
- C # to obtain the filtered or sorted data of the GridView table in devaexpress
- redis的持久化机制原理
- Cron expression (seven subexpressions)
- View all processes of multiple machines
- redis集群中hash tag 使用
- MySQL 巨坑:update 更新慎用影响行数做判断!!!
- POJ 3176-Cow Bowling(DP||记忆化搜索)
- 阻止瀏覽器後退操作
猜你喜欢

Cdga | six principles that data governance has to adhere to

comsol--三维图形随便画----回转

COMSOL -- establishment of geometric model -- establishment of two-dimensional graphics

无密码身份验证如何保障用户隐私安全?

【云原生 | Kubernetes篇】Ingress案例实战(十三)

CDGA|数据治理不得不坚持的六个原则

XML解析

pytorch-多层感知机MLP

Idea set the number of open file windows

如何让你的产品越贵越好卖
随机推荐
百问百答第45期:应用性能探针监测原理-node JS 探针
Manage multiple instagram accounts and share anti Association tips
871. Minimum Number of Refueling Stops
Sklearn model sorting
The art of communication III: Listening between people
阻止浏览器后退操作
阻止瀏覽器後退操作
FFmpeg调用avformat_open_input时返回错误 -22(Invalid argument)
I used Kaitian platform to build an urban epidemic prevention policy inquiry system [Kaitian apaas battle]
Solve the problem of slow access to foreign public static resources
1个插件搞定网页中的广告
【无标题】
SET XACT_ ABORT ON
liunx禁ping 详解traceroute的不同用法
C#实现WinForm DataGridView控件支持叠加数据绑定
C # to obtain the filtered or sorted data of the GridView table in devaexpress
pytorch-softmax回归
Harbor镜像仓库搭建
无密码身份验证如何保障用户隐私安全?
How can edge computing be combined with the Internet of things?