Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
d9b219a7
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
d9b219a7
编写于
4月 02, 2022
作者:
S
shangliang Xu
提交者:
GitHub
4月 02, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PPYOLOE] alter eval_input_size (#5569)
上级
d2e98ceb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
11 deletion
+14
-11
configs/ppyoloe/_base_/ppyoloe_crn.yml
configs/ppyoloe/_base_/ppyoloe_crn.yml
+0
-1
configs/ppyoloe/_base_/ppyoloe_reader.yml
configs/ppyoloe/_base_/ppyoloe_reader.yml
+7
-3
ppdet/modeling/heads/ppyoloe_head.py
ppdet/modeling/heads/ppyoloe_head.py
+7
-7
未找到文件。
configs/ppyoloe/_base_/ppyoloe_crn.yml
浏览文件 @
d9b219a7
...
...
@@ -28,7 +28,6 @@ PPYOLOEHead:
grid_cell_offset
:
0.5
static_assigner_epoch
:
100
use_varifocal_loss
:
True
eval_input_size
:
[
640
,
640
]
loss_weight
:
{
class
:
1.0
,
iou
:
2.5
,
dfl
:
0.5
}
static_assigner
:
name
:
ATSSAssigner
...
...
configs/ppyoloe/_base_/ppyoloe_reader.yml
浏览文件 @
d9b219a7
worker_num
:
4
eval_height
:
&eval_height
640
eval_width
:
&eval_width
640
eval_size
:
&eval_size
[
*eval_height
,
*eval_width
]
TrainReader
:
sample_transforms
:
-
Decode
:
{}
...
...
@@ -20,17 +24,17 @@ TrainReader:
EvalReader
:
sample_transforms
:
-
Decode
:
{}
-
Resize
:
{
target_size
:
[
640
,
640
]
,
keep_ratio
:
False
,
interp
:
2
}
-
Resize
:
{
target_size
:
*eval_size
,
keep_ratio
:
False
,
interp
:
2
}
-
NormalizeImage
:
{
mean
:
[
0.485
,
0.456
,
0.406
],
std
:
[
0.229
,
0.224
,
0.225
],
is_scale
:
True
}
-
Permute
:
{}
batch_size
:
2
TestReader
:
inputs_def
:
image_shape
:
[
3
,
640
,
640
]
image_shape
:
[
3
,
*eval_height
,
*eval_width
]
sample_transforms
:
-
Decode
:
{}
-
Resize
:
{
target_size
:
[
640
,
640
]
,
keep_ratio
:
False
,
interp
:
2
}
-
Resize
:
{
target_size
:
*eval_size
,
keep_ratio
:
False
,
interp
:
2
}
-
NormalizeImage
:
{
mean
:
[
0.485
,
0.456
,
0.406
],
std
:
[
0.229
,
0.224
,
0.225
],
is_scale
:
True
}
-
Permute
:
{}
batch_size
:
1
ppdet/modeling/heads/ppyoloe_head.py
浏览文件 @
d9b219a7
...
...
@@ -45,7 +45,7 @@ class ESEAttn(nn.Layer):
@
register
class
PPYOLOEHead
(
nn
.
Layer
):
__shared__
=
[
'num_classes'
,
'trt'
,
'exclude_nms'
]
__shared__
=
[
'num_classes'
,
'
eval_size'
,
'
trt'
,
'exclude_nms'
]
__inject__
=
[
'static_assigner'
,
'assigner'
,
'nms'
]
def
__init__
(
self
,
...
...
@@ -61,7 +61,7 @@ class PPYOLOEHead(nn.Layer):
static_assigner
=
'ATSSAssigner'
,
assigner
=
'TaskAlignedAssigner'
,
nms
=
'MultiClassNMS'
,
eval_
input_size
=
[]
,
eval_
size
=
None
,
loss_weight
=
{
'class'
:
1.0
,
'iou'
:
2.5
,
...
...
@@ -80,7 +80,7 @@ class PPYOLOEHead(nn.Layer):
self
.
iou_loss
=
GIoULoss
()
self
.
loss_weight
=
loss_weight
self
.
use_varifocal_loss
=
use_varifocal_loss
self
.
eval_
input_size
=
eval_input
_size
self
.
eval_
size
=
eval
_size
self
.
static_assigner_epoch
=
static_assigner_epoch
self
.
static_assigner
=
static_assigner
...
...
@@ -127,7 +127,7 @@ class PPYOLOEHead(nn.Layer):
self
.
proj
.
reshape
([
1
,
self
.
reg_max
+
1
,
1
,
1
]))
self
.
proj_conv
.
weight
.
stop_gradient
=
True
if
self
.
eval_
input_
size
:
if
self
.
eval_size
:
anchor_points
,
stride_tensor
=
self
.
_generate_anchors
()
self
.
register_buffer
(
'anchor_points'
,
anchor_points
)
self
.
register_buffer
(
'stride_tensor'
,
stride_tensor
)
...
...
@@ -164,8 +164,8 @@ class PPYOLOEHead(nn.Layer):
if
feats
is
not
None
:
_
,
_
,
h
,
w
=
feats
[
i
].
shape
else
:
h
=
int
(
self
.
eval_
input_
size
[
0
]
/
stride
)
w
=
int
(
self
.
eval_
input_
size
[
1
]
/
stride
)
h
=
int
(
self
.
eval_size
[
0
]
/
stride
)
w
=
int
(
self
.
eval_size
[
1
]
/
stride
)
shift_x
=
paddle
.
arange
(
end
=
w
)
+
self
.
grid_cell_offset
shift_y
=
paddle
.
arange
(
end
=
h
)
+
self
.
grid_cell_offset
shift_y
,
shift_x
=
paddle
.
meshgrid
(
shift_y
,
shift_x
)
...
...
@@ -181,7 +181,7 @@ class PPYOLOEHead(nn.Layer):
return
anchor_points
,
stride_tensor
def
forward_eval
(
self
,
feats
):
if
self
.
eval_
input_
size
:
if
self
.
eval_size
:
anchor_points
,
stride_tensor
=
self
.
anchor_points
,
self
.
stride_tensor
else
:
anchor_points
,
stride_tensor
=
self
.
_generate_anchors
(
feats
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录