Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yolov5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
yolov5
Commits
33a67b49
Unverified
提交
33a67b49
authored
1月 06, 2022
作者:
Glenn Jocher
提交者:
GitHub
1月 06, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update P2-P7 `models/hub` variants (#6230)
* Update p2-p7 `models/hub` variants * Update common.py * AutoAnchor camelcase corrections
上级
ad565e31
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
50 行增加
和
9 行删除
+50
-9
common.py
models/common.py
+1
-1
yolov5-p2.yaml
models/hub/yolov5-p2.yaml
+2
-2
yolov5-p34.yaml
models/hub/yolov5-p34.yaml
+41
-0
yolov5-p6.yaml
models/hub/yolov5-p6.yaml
+2
-2
yolov5-p7.yaml
models/hub/yolov5-p7.yaml
+2
-2
train.py
train.py
+1
-1
tutorial.ipynb
tutorial.ipynb
+1
-1
没有找到文件。
models/common.py
浏览文件 @
33a67b49
...
@@ -306,7 +306,7 @@ class DetectMultiBackend(nn.Module):
...
@@ -306,7 +306,7 @@ class DetectMultiBackend(nn.Module):
if
pt
:
# PyTorch
if
pt
:
# PyTorch
model
=
attempt_load
(
weights
if
isinstance
(
weights
,
list
)
else
w
,
map_location
=
device
)
model
=
attempt_load
(
weights
if
isinstance
(
weights
,
list
)
else
w
,
map_location
=
device
)
stride
=
int
(
model
.
stride
.
max
()
)
# model stride
stride
=
max
(
int
(
model
.
stride
.
max
()),
32
)
# model stride
names
=
model
.
module
.
names
if
hasattr
(
model
,
'module'
)
else
model
.
names
# get class names
names
=
model
.
module
.
names
if
hasattr
(
model
,
'module'
)
else
model
.
names
# get class names
self
.
model
=
model
# explicitly assign for to(), cpu(), cuda(), half()
self
.
model
=
model
# explicitly assign for to(), cpu(), cuda(), half()
elif
jit
:
# TorchScript
elif
jit
:
# TorchScript
...
...
models/hub/yolov5-p2.yaml
浏览文件 @
33a67b49
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
nc
:
80
# number of classes
nc
:
80
# number of classes
depth_multiple
:
1.0
# model depth multiple
depth_multiple
:
1.0
# model depth multiple
width_multiple
:
1.0
# layer channel multiple
width_multiple
:
1.0
# layer channel multiple
anchors
:
3
#
auto-a
nchor evolves 3 anchors per P output layer
anchors
:
3
#
AutoA
nchor evolves 3 anchors per P output layer
# YOLOv5 v6.0 backbone
# YOLOv5 v6.0 backbone
backbone
:
backbone
:
...
@@ -21,7 +21,7 @@ backbone:
...
@@ -21,7 +21,7 @@ backbone:
[
-1
,
1
,
SPPF
,
[
1024
,
5
]],
# 9
[
-1
,
1
,
SPPF
,
[
1024
,
5
]],
# 9
]
]
# YOLOv5 v6.0 head
# YOLOv5 v6.0 head
with (P2, P3, P4, P5) outputs
head
:
head
:
[[
-1
,
1
,
Conv
,
[
512
,
1
,
1
]],
[[
-1
,
1
,
Conv
,
[
512
,
1
,
1
]],
[
-1
,
1
,
nn.Upsample
,
[
None
,
2
,
'
nearest'
]],
[
-1
,
1
,
nn.Upsample
,
[
None
,
2
,
'
nearest'
]],
...
...
models/hub/yolov5-p34.yaml
0 → 100644
浏览文件 @
33a67b49
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license
# Parameters
nc
:
80
# number of classes
depth_multiple
:
0.33
# model depth multiple
width_multiple
:
0.50
# layer channel multiple
anchors
:
3
# AutoAnchor evolves 3 anchors per P output layer
# YOLOv5 v6.0 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
]
# YOLOv5 v6.0 head with (P3, P4) outputs
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)
[
[
17
,
20
],
1
,
Detect
,
[
nc
,
anchors
]
],
# Detect(P3, P4)
]
models/hub/yolov5-p6.yaml
浏览文件 @
33a67b49
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
nc
:
80
# number of classes
nc
:
80
# number of classes
depth_multiple
:
1.0
# model depth multiple
depth_multiple
:
1.0
# model depth multiple
width_multiple
:
1.0
# layer channel multiple
width_multiple
:
1.0
# layer channel multiple
anchors
:
3
#
auto-anchor
3 anchors per P output layer
anchors
:
3
#
AutoAnchor evolves
3 anchors per P output layer
# YOLOv5 v6.0 backbone
# YOLOv5 v6.0 backbone
backbone
:
backbone
:
...
@@ -23,7 +23,7 @@ backbone:
...
@@ -23,7 +23,7 @@ backbone:
[
-1
,
1
,
SPPF
,
[
1024
,
5
]],
# 11
[
-1
,
1
,
SPPF
,
[
1024
,
5
]],
# 11
]
]
# YOLOv5 v6.0 head
# YOLOv5 v6.0 head
with (P3, P4, P5, P6) outputs
head
:
head
:
[[
-1
,
1
,
Conv
,
[
768
,
1
,
1
]],
[[
-1
,
1
,
Conv
,
[
768
,
1
,
1
]],
[
-1
,
1
,
nn.Upsample
,
[
None
,
2
,
'
nearest'
]],
[
-1
,
1
,
nn.Upsample
,
[
None
,
2
,
'
nearest'
]],
...
...
models/hub/yolov5-p7.yaml
浏览文件 @
33a67b49
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
nc
:
80
# number of classes
nc
:
80
# number of classes
depth_multiple
:
1.0
# model depth multiple
depth_multiple
:
1.0
# model depth multiple
width_multiple
:
1.0
# layer channel multiple
width_multiple
:
1.0
# layer channel multiple
anchors
:
3
#
auto-anchor
3 anchors per P output layer
anchors
:
3
#
AutoAnchor evolves
3 anchors per P output layer
# YOLOv5 v6.0 backbone
# YOLOv5 v6.0 backbone
backbone
:
backbone
:
...
@@ -25,7 +25,7 @@ backbone:
...
@@ -25,7 +25,7 @@ backbone:
[
-1
,
1
,
SPPF
,
[
1280
,
5
]],
# 13
[
-1
,
1
,
SPPF
,
[
1280
,
5
]],
# 13
]
]
# YOLOv5
head
# YOLOv5
v6.0 head with (P3, P4, P5, P6, P7) outputs
head
:
head
:
[[
-1
,
1
,
Conv
,
[
1024
,
1
,
1
]],
[[
-1
,
1
,
Conv
,
[
1024
,
1
,
1
]],
[
-1
,
1
,
nn.Upsample
,
[
None
,
2
,
'
nearest'
]],
[
-1
,
1
,
nn.Upsample
,
[
None
,
2
,
'
nearest'
]],
...
...
train.py
浏览文件 @
33a67b49
...
@@ -461,7 +461,7 @@ def parse_opt(known=False):
...
@@ -461,7 +461,7 @@ def parse_opt(known=False):
parser
.
add_argument
(
'--resume'
,
nargs
=
'?'
,
const
=
True
,
default
=
False
,
help
=
'resume most recent training'
)
parser
.
add_argument
(
'--resume'
,
nargs
=
'?'
,
const
=
True
,
default
=
False
,
help
=
'resume most recent training'
)
parser
.
add_argument
(
'--nosave'
,
action
=
'store_true'
,
help
=
'only save final checkpoint'
)
parser
.
add_argument
(
'--nosave'
,
action
=
'store_true'
,
help
=
'only save final checkpoint'
)
parser
.
add_argument
(
'--noval'
,
action
=
'store_true'
,
help
=
'only validate final epoch'
)
parser
.
add_argument
(
'--noval'
,
action
=
'store_true'
,
help
=
'only validate final epoch'
)
parser
.
add_argument
(
'--noautoanchor'
,
action
=
'store_true'
,
help
=
'disable
autoanchor check
'
)
parser
.
add_argument
(
'--noautoanchor'
,
action
=
'store_true'
,
help
=
'disable
AutoAnchor
'
)
parser
.
add_argument
(
'--evolve'
,
type
=
int
,
nargs
=
'?'
,
const
=
300
,
help
=
'evolve hyperparameters for x generations'
)
parser
.
add_argument
(
'--evolve'
,
type
=
int
,
nargs
=
'?'
,
const
=
300
,
help
=
'evolve hyperparameters for x generations'
)
parser
.
add_argument
(
'--bucket'
,
type
=
str
,
default
=
''
,
help
=
'gsutil bucket'
)
parser
.
add_argument
(
'--bucket'
,
type
=
str
,
default
=
''
,
help
=
'gsutil bucket'
)
parser
.
add_argument
(
'--cache'
,
type
=
str
,
nargs
=
'?'
,
const
=
'ram'
,
help
=
'--cache images in "ram" (default) or "disk"'
)
parser
.
add_argument
(
'--cache'
,
type
=
str
,
nargs
=
'?'
,
const
=
'ram'
,
help
=
'--cache images in "ram" (default) or "disk"'
)
...
...
tutorial.ipynb
浏览文件 @
33a67b49
...
@@ -777,7 +777,7 @@
...
@@ -777,7 +777,7 @@
"\u001b[34m\u001b[1mval: \u001b[0mCaching images (0.1GB ram): 100% 128/128 [00:01<00:00, 121.58it/s]\n",
"\u001b[34m\u001b[1mval: \u001b[0mCaching images (0.1GB ram): 100% 128/128 [00:01<00:00, 121.58it/s]\n",
"Plotting labels... \n",
"Plotting labels... \n",
"\n",
"\n",
"\u001b[34m\u001b[1m
autoa
nchor: \u001b[0mAnalyzing anchors... anchors/target = 4.27, Best Possible Recall (BPR) = 0.9935\n",
"\u001b[34m\u001b[1m
AutoA
nchor: \u001b[0mAnalyzing anchors... anchors/target = 4.27, Best Possible Recall (BPR) = 0.9935\n",
"Image sizes 640 train, 640 val\n",
"Image sizes 640 train, 640 val\n",
"Using 2 dataloader workers\n",
"Using 2 dataloader workers\n",
"Logging results to \u001b[1mruns/train/exp\u001b[0m\n",
"Logging results to \u001b[1mruns/train/exp\u001b[0m\n",
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论