Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleHub
提交
56d59751
P
PaddleHub
项目概览
PaddlePaddle
/
PaddleHub
大约 1 年 前同步成功
通知
282
Star
12117
Fork
2091
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
200
列表
看板
标记
里程碑
合并请求
4
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleHub
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
200
Issue
200
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
56d59751
编写于
5月 24, 2022
作者:
C
chenjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
2957e638
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
1 addition
and
17 deletion
+1
-17
modules/image/keypoint_detection/pp-tinypose/infer.py
modules/image/keypoint_detection/pp-tinypose/infer.py
+1
-7
modules/image/keypoint_detection/pp-tinypose/keypoint_infer.py
...es/image/keypoint_detection/pp-tinypose/keypoint_infer.py
+0
-10
未找到文件。
modules/image/keypoint_detection/pp-tinypose/infer.py
浏览文件 @
56d59751
...
...
@@ -219,20 +219,14 @@ class Detector(object):
end_index
=
min
((
i
+
1
)
*
self
.
batch_size
,
len
(
image_list
))
batch_image_list
=
image_list
[
start_index
:
end_index
]
# preprocess
self
.
det_times
.
preprocess_time_s
.
start
()
inputs
=
self
.
preprocess
(
batch_image_list
)
self
.
det_times
.
preprocess_time_s
.
end
()
# model prediction
self
.
det_times
.
inference_time_s
.
start
()
result
=
self
.
predict
()
self
.
det_times
.
inference_time_s
.
end
()
# postprocess
self
.
det_times
.
postprocess_time_s
.
start
()
result
=
self
.
postprocess
(
inputs
,
result
)
self
.
det_times
.
postprocess_time_s
.
end
()
self
.
det_times
.
img_num
+=
len
(
batch_image_list
)
if
visual
:
visualize
(
batch_image_list
,
...
...
modules/image/keypoint_detection/pp-tinypose/keypoint_infer.py
浏览文件 @
56d59751
...
...
@@ -91,7 +91,6 @@ class KeyPointDetector(Detector):
def
get_person_from_rect
(
self
,
image
,
results
):
# crop the person result from image
self
.
det_times
.
preprocess_time_s
.
start
()
valid_rects
=
results
[
'boxes'
]
rect_images
=
[]
new_rects
=
[]
...
...
@@ -103,7 +102,6 @@ class KeyPointDetector(Detector):
rect_images
.
append
(
rect_image
)
new_rects
.
append
(
new_rect
)
org_rects
.
append
(
org_rect
)
self
.
det_times
.
preprocess_time_s
.
end
()
return
rect_images
,
new_rects
,
org_rects
def
postprocess
(
self
,
inputs
,
result
):
...
...
@@ -168,20 +166,12 @@ class KeyPointDetector(Detector):
end_index
=
min
((
i
+
1
)
*
self
.
batch_size
,
len
(
image_list
))
batch_image_list
=
image_list
[
start_index
:
end_index
]
# preprocess
self
.
det_times
.
preprocess_time_s
.
start
()
inputs
=
self
.
preprocess
(
batch_image_list
)
self
.
det_times
.
preprocess_time_s
.
end
()
# model prediction
self
.
det_times
.
inference_time_s
.
start
()
result
=
self
.
predict
()
self
.
det_times
.
inference_time_s
.
end
()
# postprocess
self
.
det_times
.
postprocess_time_s
.
start
()
result
=
self
.
postprocess
(
inputs
,
result
)
self
.
det_times
.
postprocess_time_s
.
end
()
self
.
det_times
.
img_num
+=
len
(
batch_image_list
)
if
visual
:
if
not
os
.
path
.
exists
(
self
.
output_dir
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录