Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
2ecc6525
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看板
未验证
提交
2ecc6525
编写于
7月 08, 2021
作者:
G
George Ni
提交者:
GitHub
7月 08, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[MOT] fix jde tensorrt deploy (#3617)
上级
c0cb4407
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
25 deletion
+28
-25
ppdet/engine/export_utils.py
ppdet/engine/export_utils.py
+1
-1
ppdet/modeling/layers.py
ppdet/modeling/layers.py
+26
-22
ppdet/modeling/reid/jde_embedding_head.py
ppdet/modeling/reid/jde_embedding_head.py
+1
-2
未找到文件。
ppdet/engine/export_utils.py
浏览文件 @
2ecc6525
...
...
@@ -40,7 +40,7 @@ TRT_MIN_SUBGRAPH = {
'HigherHRNet'
:
3
,
'HRNet'
:
3
,
'DeepSORT'
:
3
,
'JDE'
:
3
,
'JDE'
:
10
,
'FairMOT'
:
5
,
}
...
...
ppdet/modeling/layers.py
浏览文件 @
2ecc6525
...
...
@@ -927,37 +927,41 @@ class JDEBox(object):
gy2
=
gy
+
gh
*
0.5
return
paddle
.
stack
([
gx1
,
gy1
,
gx2
,
gy2
],
axis
=
1
)
def
decode_delta_map
(
self
,
delta_map
,
anchors
):
nB
,
nA
,
nGh
,
nGw
,
_
=
delta_map
.
shape
[:]
anchor_mesh
=
self
.
generate_anchor
(
nGh
,
nGw
,
anchors
)
# only support bs=1
def
decode_delta_map
(
self
,
nA
,
nGh
,
nGw
,
delta_map
,
anchor_vec
):
anchor_mesh
=
self
.
generate_anchor
(
nGh
,
nGw
,
anchor_vec
)
anchor_mesh
=
paddle
.
unsqueeze
(
anchor_mesh
,
0
)
pred_list
=
self
.
decode_delta
(
paddle
.
reshape
(
delta_map
,
shape
=
[
-
1
,
4
]),
paddle
.
reshape
(
anchor_mesh
,
shape
=
[
-
1
,
4
]))
pred_map
=
paddle
.
reshape
(
pred_list
,
shape
=
[
n
B
,
n
A
*
nGh
*
nGw
,
4
])
pred_map
=
paddle
.
reshape
(
pred_list
,
shape
=
[
nA
*
nGh
*
nGw
,
4
])
return
pred_map
def
_postprocessing_by_level
(
self
,
nA
,
stride
,
head_out
,
anchor_vec
):
boxes_shape
=
head_out
.
shape
nB
,
nGh
,
nGw
=
1
,
boxes_shape
[
-
2
],
boxes_shape
[
-
1
]
# only support bs=1
p
=
paddle
.
reshape
(
head_out
,
shape
=
[
nB
,
nA
,
self
.
num_classes
+
5
,
nGh
,
nGw
])
p
=
paddle
.
transpose
(
p
,
perm
=
[
0
,
1
,
3
,
4
,
2
])
# [nB, 4, nGh, nGw, 6]
p_box
=
p
[:,
:,
:,
:,
:
4
]
boxes
=
self
.
decode_delta_map
(
p_box
,
anchor_vec
)
# [nB, 4*nGh*nGw, 4]
boxes
=
boxes
*
stride
p_conf
=
paddle
.
transpose
(
p
[:,
:,
:,
:,
4
:
6
],
perm
=
[
0
,
4
,
1
,
2
,
3
])
# [nB, 2, 4, 19, 34]
p_conf
=
F
.
softmax
(
p_conf
,
axis
=
1
)[:,
1
,
:,
:,
:].
unsqueeze
(
-
1
)
# [nB, 4, 19, 34, 1]
scores
=
paddle
.
reshape
(
p_conf
,
shape
=
[
nB
,
nA
*
nGh
*
nGw
,
1
])
return
boxes
,
scores
boxes_shape
=
head_out
.
shape
# [nB, nA*6, nGh, nGw]
nGh
,
nGw
=
boxes_shape
[
-
2
],
boxes_shape
[
-
1
]
nB
=
1
# TODO: only support bs=1 now
boxes_list
,
scores_list
=
[],
[]
for
idx
in
range
(
nB
):
p
=
paddle
.
reshape
(
head_out
[
idx
],
shape
=
[
nA
,
self
.
num_classes
+
5
,
nGh
,
nGw
])
p
=
paddle
.
transpose
(
p
,
perm
=
[
0
,
2
,
3
,
1
])
# [nA, nGh, nGw, 6]
delta_map
=
p
[:,
:,
:,
:
4
]
boxes
=
self
.
decode_delta_map
(
nA
,
nGh
,
nGw
,
delta_map
,
anchor_vec
)
# [nA * nGh * nGw, 4]
boxes_list
.
append
(
boxes
*
stride
)
p_conf
=
paddle
.
transpose
(
p
[:,
:,
:,
4
:
6
],
perm
=
[
3
,
0
,
1
,
2
])
# [2, nA, nGh, nGw]
p_conf
=
F
.
softmax
(
p_conf
,
axis
=
0
)[
1
,
:,
:,
:].
unsqueeze
(
-
1
)
# [nA, nGh, nGw, 1]
scores
=
paddle
.
reshape
(
p_conf
,
shape
=
[
nA
*
nGh
*
nGw
,
1
])
scores_list
.
append
(
scores
)
boxes_results
=
paddle
.
stack
(
boxes_list
)
scores_results
=
paddle
.
stack
(
scores_list
)
return
boxes_results
,
scores_results
def
__call__
(
self
,
yolo_head_out
,
anchors
):
bbox_pred_list
=
[]
...
...
ppdet/modeling/reid/jde_embedding_head.py
浏览文件 @
2ecc6525
...
...
@@ -175,8 +175,7 @@ class JDEEmbeddingHead(nn.Layer):
for
i
,
p_ide
in
enumerate
(
ide_outs
):
p_ide
=
p_ide
.
transpose
((
0
,
2
,
3
,
1
))
p_ide_repeat
=
paddle
.
tile
(
p_ide
.
unsqueeze
(
axis
=
0
),
[
1
,
self
.
anchor_scales
,
1
,
1
,
1
])
p_ide_repeat
=
paddle
.
tile
(
p_ide
,
[
self
.
anchor_scales
,
1
,
1
,
1
])
embedding
=
F
.
normalize
(
p_ide_repeat
,
axis
=-
1
)
emb
=
paddle
.
reshape
(
embedding
,
[
-
1
,
self
.
embedding_dim
])
emb_outs
.
append
(
emb
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录