Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
钢镚是个小屁精
yolov7-obb
提交
01e1c8fa
Y
yolov7-obb
项目概览
钢镚是个小屁精
/
yolov7-obb
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
yolov7-obb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
01e1c8fa
编写于
8月 27, 2022
作者:
Bubbliiiing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update model_name
上级
4324a006
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
19 deletion
+18
-19
nets/backbone.py
nets/backbone.py
+11
-11
nets/yolo.py
nets/yolo.py
+7
-7
nets/yolo_training.py
nets/yolo_training.py
+0
-1
未找到文件。
nets/backbone.py
浏览文件 @
01e1c8fa
...
...
@@ -25,9 +25,9 @@ class Conv(nn.Module):
def
fuseforward
(
self
,
x
):
return
self
.
act
(
self
.
conv
(
x
))
class
Block
(
nn
.
Module
):
class
Multi_Concat_
Block
(
nn
.
Module
):
def
__init__
(
self
,
c1
,
c2
,
c3
,
n
=
4
,
e
=
1
,
ids
=
[
0
]):
super
(
Block
,
self
).
__init__
()
super
(
Multi_Concat_
Block
,
self
).
__init__
()
c_
=
int
(
c2
*
e
)
self
.
ids
=
ids
...
...
@@ -58,9 +58,9 @@ class MP(nn.Module):
def
forward
(
self
,
x
):
return
self
.
m
(
x
)
class
Transition
(
nn
.
Module
):
class
Transition
_Block
(
nn
.
Module
):
def
__init__
(
self
,
c1
,
c2
):
super
(
Transition
,
self
).
__init__
()
super
(
Transition
_Block
,
self
).
__init__
()
self
.
cv1
=
Conv
(
c1
,
c2
,
1
,
1
)
self
.
cv2
=
Conv
(
c1
,
c2
,
1
,
1
)
self
.
cv3
=
Conv
(
c2
,
c2
,
3
,
2
)
...
...
@@ -93,19 +93,19 @@ class Backbone(nn.Module):
)
self
.
dark2
=
nn
.
Sequential
(
Conv
(
transition_channels
*
2
,
transition_channels
*
4
,
3
,
2
),
Block
(
transition_channels
*
4
,
block_channels
*
2
,
transition_channels
*
8
,
n
=
n
,
ids
=
ids
),
Multi_Concat_
Block
(
transition_channels
*
4
,
block_channels
*
2
,
transition_channels
*
8
,
n
=
n
,
ids
=
ids
),
)
self
.
dark3
=
nn
.
Sequential
(
Transition
(
transition_channels
*
8
,
transition_channels
*
4
),
Block
(
transition_channels
*
8
,
block_channels
*
4
,
transition_channels
*
16
,
n
=
n
,
ids
=
ids
),
Transition
_Block
(
transition_channels
*
8
,
transition_channels
*
4
),
Multi_Concat_
Block
(
transition_channels
*
8
,
block_channels
*
4
,
transition_channels
*
16
,
n
=
n
,
ids
=
ids
),
)
self
.
dark4
=
nn
.
Sequential
(
Transition
(
transition_channels
*
16
,
transition_channels
*
8
),
Block
(
transition_channels
*
16
,
block_channels
*
8
,
transition_channels
*
32
,
n
=
n
,
ids
=
ids
),
Transition
_Block
(
transition_channels
*
16
,
transition_channels
*
8
),
Multi_Concat_
Block
(
transition_channels
*
16
,
block_channels
*
8
,
transition_channels
*
32
,
n
=
n
,
ids
=
ids
),
)
self
.
dark5
=
nn
.
Sequential
(
Transition
(
transition_channels
*
32
,
transition_channels
*
16
),
Block
(
transition_channels
*
32
,
block_channels
*
8
,
transition_channels
*
32
,
n
=
n
,
ids
=
ids
),
Transition
_Block
(
transition_channels
*
32
,
transition_channels
*
16
),
Multi_Concat_
Block
(
transition_channels
*
32
,
block_channels
*
8
,
transition_channels
*
32
,
n
=
n
,
ids
=
ids
),
)
if
pretrained
:
...
...
nets/yolo.py
浏览文件 @
01e1c8fa
...
...
@@ -2,7 +2,7 @@ import numpy as np
import
torch
import
torch.nn
as
nn
from
nets.backbone
import
Backbone
,
Block
,
Conv
,
SiLU
,
Transition
,
autopad
from
nets.backbone
import
Backbone
,
Multi_Concat_Block
,
Conv
,
SiLU
,
Transition_Block
,
autopad
class
SPPCSPC
(
nn
.
Module
):
...
...
@@ -240,17 +240,17 @@ class YoloBody(nn.Module):
self
.
sppcspc
=
SPPCSPC
(
transition_channels
*
32
,
transition_channels
*
16
)
self
.
conv_for_P5
=
Conv
(
transition_channels
*
16
,
transition_channels
*
8
)
self
.
conv_for_feat2
=
Conv
(
transition_channels
*
32
,
transition_channels
*
8
)
self
.
conv3_for_upsample1
=
Block
(
transition_channels
*
16
,
panet_channels
*
4
,
transition_channels
*
8
,
e
=
e
,
n
=
n
,
ids
=
ids
)
self
.
conv3_for_upsample1
=
Multi_Concat_
Block
(
transition_channels
*
16
,
panet_channels
*
4
,
transition_channels
*
8
,
e
=
e
,
n
=
n
,
ids
=
ids
)
self
.
conv_for_P4
=
Conv
(
transition_channels
*
8
,
transition_channels
*
4
)
self
.
conv_for_feat1
=
Conv
(
transition_channels
*
16
,
transition_channels
*
4
)
self
.
conv3_for_upsample2
=
Block
(
transition_channels
*
8
,
panet_channels
*
2
,
transition_channels
*
4
,
e
=
e
,
n
=
n
,
ids
=
ids
)
self
.
conv3_for_upsample2
=
Multi_Concat_
Block
(
transition_channels
*
8
,
panet_channels
*
2
,
transition_channels
*
4
,
e
=
e
,
n
=
n
,
ids
=
ids
)
self
.
down_sample1
=
Transition
(
transition_channels
*
4
,
transition_channels
*
4
)
self
.
conv3_for_downsample1
=
Block
(
transition_channels
*
16
,
panet_channels
*
4
,
transition_channels
*
8
,
e
=
e
,
n
=
n
,
ids
=
ids
)
self
.
down_sample1
=
Transition
_Block
(
transition_channels
*
4
,
transition_channels
*
4
)
self
.
conv3_for_downsample1
=
Multi_Concat_
Block
(
transition_channels
*
16
,
panet_channels
*
4
,
transition_channels
*
8
,
e
=
e
,
n
=
n
,
ids
=
ids
)
self
.
down_sample2
=
Transition
(
transition_channels
*
8
,
transition_channels
*
8
)
self
.
conv3_for_downsample2
=
Block
(
transition_channels
*
32
,
panet_channels
*
8
,
transition_channels
*
16
,
e
=
e
,
n
=
n
,
ids
=
ids
)
self
.
down_sample2
=
Transition
_Block
(
transition_channels
*
8
,
transition_channels
*
8
)
self
.
conv3_for_downsample2
=
Multi_Concat_
Block
(
transition_channels
*
32
,
panet_channels
*
8
,
transition_channels
*
16
,
e
=
e
,
n
=
n
,
ids
=
ids
)
self
.
rep_conv_1
=
conv
(
transition_channels
*
4
,
transition_channels
*
8
,
3
,
1
)
self
.
rep_conv_2
=
conv
(
transition_channels
*
8
,
transition_channels
*
16
,
3
,
1
)
...
...
nets/yolo_training.py
浏览文件 @
01e1c8fa
...
...
@@ -8,7 +8,6 @@ import torch.nn as nn
import
torch.nn.functional
as
F
def
smooth_BCE
(
eps
=
0.1
):
# https://github.com/ultralytics/yolov3/issues/238#issuecomment-598028441
# return positive, negative label smoothing BCE targets
return
1.0
-
0.5
*
eps
,
0.5
*
eps
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录