Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yolov5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
yolov5
Commits
9c6732f6
Unverified
提交
9c6732f6
authored
8月 02, 2021
作者:
Glenn Jocher
提交者:
GitHub
8月 02, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update variables (#4273)
上级
306fc011
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
7 行增加
和
7 行删除
+7
-7
common.py
models/common.py
+7
-7
没有找到文件。
models/common.py
浏览文件 @
9c6732f6
...
@@ -30,7 +30,7 @@ def autopad(k, p=None): # kernel, padding
...
@@ -30,7 +30,7 @@ def autopad(k, p=None): # kernel, padding
def
DWConv
(
c1
,
c2
,
k
=
1
,
s
=
1
,
act
=
True
):
def
DWConv
(
c1
,
c2
,
k
=
1
,
s
=
1
,
act
=
True
):
# Depthwise convolution
# Depth
-
wise convolution
return
Conv
(
c1
,
c2
,
k
,
s
,
g
=
math
.
gcd
(
c1
,
c2
),
act
=
act
)
return
Conv
(
c1
,
c2
,
k
,
s
,
g
=
math
.
gcd
(
c1
,
c2
),
act
=
act
)
...
@@ -183,11 +183,11 @@ class Contract(nn.Module):
...
@@ -183,11 +183,11 @@ class Contract(nn.Module):
self
.
gain
=
gain
self
.
gain
=
gain
def
forward
(
self
,
x
):
def
forward
(
self
,
x
):
N
,
C
,
H
,
W
=
x
.
size
()
# assert (H
/ s == 0) and (W / s == 0), 'Indivisible gain'
b
,
c
,
h
,
w
=
x
.
size
()
# assert (h
/ s == 0) and (W / s == 0), 'Indivisible gain'
s
=
self
.
gain
s
=
self
.
gain
x
=
x
.
view
(
N
,
C
,
H
//
s
,
s
,
W
//
s
,
s
)
# x(1,64,40,2,40,2)
x
=
x
.
view
(
b
,
c
,
h
//
s
,
s
,
w
//
s
,
s
)
# x(1,64,40,2,40,2)
x
=
x
.
permute
(
0
,
3
,
5
,
1
,
2
,
4
)
.
contiguous
()
# x(1,2,2,64,40,40)
x
=
x
.
permute
(
0
,
3
,
5
,
1
,
2
,
4
)
.
contiguous
()
# x(1,2,2,64,40,40)
return
x
.
view
(
N
,
C
*
s
*
s
,
H
//
s
,
W
//
s
)
# x(1,256,40,40)
return
x
.
view
(
b
,
c
*
s
*
s
,
h
//
s
,
w
//
s
)
# x(1,256,40,40)
class
Expand
(
nn
.
Module
):
class
Expand
(
nn
.
Module
):
...
@@ -197,11 +197,11 @@ class Expand(nn.Module):
...
@@ -197,11 +197,11 @@ class Expand(nn.Module):
self
.
gain
=
gain
self
.
gain
=
gain
def
forward
(
self
,
x
):
def
forward
(
self
,
x
):
N
,
C
,
H
,
W
=
x
.
size
()
# assert C / s ** 2 == 0, 'Indivisible gain'
b
,
c
,
h
,
w
=
x
.
size
()
# assert C / s ** 2 == 0, 'Indivisible gain'
s
=
self
.
gain
s
=
self
.
gain
x
=
x
.
view
(
N
,
s
,
s
,
C
//
s
**
2
,
H
,
W
)
# x(1,2,2,16,80,80)
x
=
x
.
view
(
b
,
s
,
s
,
c
//
s
**
2
,
h
,
w
)
# x(1,2,2,16,80,80)
x
=
x
.
permute
(
0
,
3
,
4
,
1
,
5
,
2
)
.
contiguous
()
# x(1,16,80,2,80,2)
x
=
x
.
permute
(
0
,
3
,
4
,
1
,
5
,
2
)
.
contiguous
()
# x(1,16,80,2,80,2)
return
x
.
view
(
N
,
C
//
s
**
2
,
H
*
s
,
W
*
s
)
# x(1,16,160,160)
return
x
.
view
(
b
,
c
//
s
**
2
,
h
*
s
,
w
*
s
)
# x(1,16,160,160)
class
Concat
(
nn
.
Module
):
class
Concat
(
nn
.
Module
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论