Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
fb2c24a0
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看板
未验证
提交
fb2c24a0
编写于
1月 04, 2022
作者:
G
Guanghua Yu
提交者:
GitHub
1月 04, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support export post_process in PicoDet (#5044)
* support export post_process in PicoDet
上级
1a46f29f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
2 deletion
+6
-2
configs/picodet/_base_/picodet_esnet.yml
configs/picodet/_base_/picodet_esnet.yml
+1
-0
ppdet/engine/export_utils.py
ppdet/engine/export_utils.py
+2
-0
ppdet/engine/trainer.py
ppdet/engine/trainer.py
+3
-2
未找到文件。
configs/picodet/_base_/picodet_esnet.yml
浏览文件 @
fb2c24a0
architecture
:
PicoDet
architecture
:
PicoDet
pretrain_weights
:
https://paddledet.bj.bcebos.com/models/pretrained/ESNet_x1_0_pretrained.pdparams
pretrain_weights
:
https://paddledet.bj.bcebos.com/models/pretrained/ESNet_x1_0_pretrained.pdparams
export_post_process
:
False
# Whether post-processing is included in the network
PicoDet
:
PicoDet
:
backbone
:
ESNet
backbone
:
ESNet
...
...
ppdet/engine/export_utils.py
浏览文件 @
fb2c24a0
...
@@ -165,6 +165,8 @@ def _dump_infer_config(config, path, image_shape, model):
...
@@ -165,6 +165,8 @@ def _dump_infer_config(config, path, image_shape, model):
reader_cfg
,
dataset_cfg
,
config
[
'metric'
],
label_arch
,
image_shape
[
1
:])
reader_cfg
,
dataset_cfg
,
config
[
'metric'
],
label_arch
,
image_shape
[
1
:])
if
infer_arch
==
'PicoDet'
:
if
infer_arch
==
'PicoDet'
:
if
config
.
get
(
'export_post_process'
,
False
):
infer_cfg
[
'arch'
]
=
'GFL'
infer_cfg
[
'NMS'
]
=
config
[
'PicoHead'
][
'nms'
]
infer_cfg
[
'NMS'
]
=
config
[
'PicoHead'
][
'nms'
]
# In order to speed up the prediction, the threshold of nms
# In order to speed up the prediction, the threshold of nms
# is adjusted here, which can be changed in infer_cfg.yml
# is adjusted here, which can be changed in infer_cfg.yml
...
...
ppdet/engine/trainer.py
浏览文件 @
fb2c24a0
...
@@ -631,7 +631,8 @@ class Trainer(object):
...
@@ -631,7 +631,8 @@ class Trainer(object):
im_shape
=
[
image_shape
[
0
],
2
]
im_shape
=
[
image_shape
[
0
],
2
]
scale_factor
=
[
image_shape
[
0
],
2
]
scale_factor
=
[
image_shape
[
0
],
2
]
if
hasattr
(
self
.
model
,
'deploy'
):
export_post_process
=
self
.
cfg
.
get
(
'export_post_process'
,
False
)
if
hasattr
(
self
.
model
,
'deploy'
)
and
not
export_post_process
:
self
.
model
.
deploy
=
True
self
.
model
.
deploy
=
True
if
hasattr
(
self
.
model
,
'fuse_norm'
):
if
hasattr
(
self
.
model
,
'fuse_norm'
):
self
.
model
.
fuse_norm
=
self
.
cfg
[
'TestReader'
].
get
(
'fuse_normalize'
,
self
.
model
.
fuse_norm
=
self
.
cfg
[
'TestReader'
].
get
(
'fuse_normalize'
,
...
@@ -668,7 +669,7 @@ class Trainer(object):
...
@@ -668,7 +669,7 @@ class Trainer(object):
pruned_input_spec
=
input_spec
pruned_input_spec
=
input_spec
# TODO: Hard code, delete it when support prune input_spec.
# TODO: Hard code, delete it when support prune input_spec.
if
self
.
cfg
.
architecture
==
'PicoDet'
:
if
self
.
cfg
.
architecture
==
'PicoDet'
and
not
export_post_process
:
pruned_input_spec
=
[{
pruned_input_spec
=
[{
"image"
:
InputSpec
(
"image"
:
InputSpec
(
shape
=
image_shape
,
name
=
'image'
)
shape
=
image_shape
,
name
=
'image'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录