Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
28199de7
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看板
未验证
提交
28199de7
编写于
8月 17, 2022
作者:
Z
zhiboniu
提交者:
GitHub
8月 17, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add per trackid time info (#6664)
上级
601964b4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
4 deletion
+10
-4
deploy/pipeline/pipe_utils.py
deploy/pipeline/pipe_utils.py
+5
-1
deploy/pipeline/pipeline.py
deploy/pipeline/pipeline.py
+5
-3
未找到文件。
deploy/pipeline/pipe_utils.py
浏览文件 @
28199de7
...
@@ -68,6 +68,7 @@ class PipeTimer(Times):
...
@@ -68,6 +68,7 @@ class PipeTimer(Times):
'vehicleplate'
:
Times
()
'vehicleplate'
:
Times
()
}
}
self
.
img_num
=
0
self
.
img_num
=
0
self
.
track_num
=
0
def
get_total_time
(
self
):
def
get_total_time
(
self
):
total_time
=
self
.
total_time
.
value
()
total_time
=
self
.
total_time
.
value
()
...
@@ -86,8 +87,11 @@ class PipeTimer(Times):
...
@@ -86,8 +87,11 @@ class PipeTimer(Times):
for
k
,
v
in
self
.
module_time
.
items
():
for
k
,
v
in
self
.
module_time
.
items
():
v_time
=
round
(
v
.
value
(),
4
)
v_time
=
round
(
v
.
value
(),
4
)
if
v_time
>
0
:
if
v_time
>
0
and
k
in
[
'det'
,
'mot'
,
'video_action'
]
:
print
(
"{} time(ms): {}"
.
format
(
k
,
v_time
*
1000
))
print
(
"{} time(ms): {}"
.
format
(
k
,
v_time
*
1000
))
elif
v_time
>
0
:
print
(
"{} time(ms): {}; per trackid average time(ms): {}"
.
format
(
k
,
v_time
*
1000
,
v_time
*
1000
/
self
.
track_num
))
print
(
"average latency time(ms): {:.2f}, QPS: {:2f}"
.
format
(
print
(
"average latency time(ms): {:.2f}, QPS: {:2f}"
.
format
(
average_latency
*
1000
,
qps
))
average_latency
*
1000
,
qps
))
...
...
deploy/pipeline/pipeline.py
浏览文件 @
28199de7
...
@@ -598,10 +598,11 @@ class PipePredictor(object):
...
@@ -598,10 +598,11 @@ class PipePredictor(object):
if
not
ret
:
if
not
ret
:
break
break
frame_rgb
=
cv2
.
cvtColor
(
frame
,
cv2
.
COLOR_BGR2RGB
)
frame_rgb
=
cv2
.
cvtColor
(
frame
,
cv2
.
COLOR_BGR2RGB
)
if
frame_id
>
self
.
warmup_frame
:
self
.
pipe_timer
.
total_time
.
start
()
if
self
.
modebase
[
"idbased"
]
or
self
.
modebase
[
"skeletonbased"
]:
if
self
.
modebase
[
"idbased"
]
or
self
.
modebase
[
"skeletonbased"
]:
if
frame_id
>
self
.
warmup_frame
:
if
frame_id
>
self
.
warmup_frame
:
self
.
pipe_timer
.
total_time
.
start
()
self
.
pipe_timer
.
module_time
[
'mot'
].
start
()
self
.
pipe_timer
.
module_time
[
'mot'
].
start
()
mot_skip_frame_num
=
self
.
mot_predictor
.
skip_frame_num
mot_skip_frame_num
=
self
.
mot_predictor
.
skip_frame_num
...
@@ -612,11 +613,12 @@ class PipePredictor(object):
...
@@ -612,11 +613,12 @@ class PipePredictor(object):
[
copy
.
deepcopy
(
frame_rgb
)],
[
copy
.
deepcopy
(
frame_rgb
)],
visual
=
False
,
visual
=
False
,
reuse_det_result
=
reuse_det_result
)
reuse_det_result
=
reuse_det_result
)
if
frame_id
>
self
.
warmup_frame
:
self
.
pipe_timer
.
module_time
[
'mot'
].
end
()
# mot output format: id, class, score, xmin, ymin, xmax, ymax
# mot output format: id, class, score, xmin, ymin, xmax, ymax
mot_res
=
parse_mot_res
(
res
)
mot_res
=
parse_mot_res
(
res
)
if
frame_id
>
self
.
warmup_frame
:
self
.
pipe_timer
.
module_time
[
'mot'
].
end
()
self
.
pipe_timer
.
track_num
+=
len
(
mot_res
[
'boxes'
])
# flow_statistic only support single class MOT
# flow_statistic only support single class MOT
boxes
,
scores
,
ids
=
res
[
0
]
# batch size = 1 in MOT
boxes
,
scores
,
ids
=
res
[
0
]
# batch size = 1 in MOT
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录