Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleHub
提交
96baa2b8
P
PaddleHub
项目概览
PaddlePaddle
/
PaddleHub
1 年多 前同步成功
通知
283
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看板
未验证
提交
96baa2b8
编写于
11月 04, 2022
作者:
jm_12138
提交者:
GitHub
11月 04, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update openpose_hands_estimation (#1971)
* update openpose_hands_estimation * add clean func
上级
d430fc35
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
84 addition
and
5 deletion
+84
-5
modules/image/keypoint_detection/openpose_hands_estimation/module.py
...ge/keypoint_detection/openpose_hands_estimation/module.py
+3
-4
modules/image/keypoint_detection/openpose_hands_estimation/readme.md
...ge/keypoint_detection/openpose_hands_estimation/readme.md
+3
-1
modules/image/keypoint_detection/openpose_hands_estimation/test.py
...mage/keypoint_detection/openpose_hands_estimation/test.py
+78
-0
未找到文件。
modules/image/keypoint_detection/openpose_hands_estimation/module.py
浏览文件 @
96baa2b8
...
...
@@ -13,7 +13,6 @@
# limitations under the License.
import
os
import
base64
import
copy
import
time
import
argparse
...
...
@@ -26,11 +25,11 @@ import numpy as np
import
paddle.nn
as
nn
import
paddlehub
as
hub
from
skimage.measure
import
label
from
scipy.ndimage
.filters
import
gaussian_filter
from
scipy.ndimage
import
gaussian_filter
from
paddlehub.module.module
import
moduleinfo
,
runnable
,
serving
import
paddlehub.vision.transforms
as
T
import
openpose_hands_estimation.
processor
as
P
from
.
import
processor
as
P
@
moduleinfo
(
...
...
@@ -40,7 +39,7 @@ import openpose_hands_estimation.processor as P
author_email
=
""
,
summary
=
"Openpose_hands_estimation is a hand pose estimation model based on Hand Keypoint Detection in
\
Single Images using Multiview Bootstrapping."
,
version
=
"1.
0
.0"
)
version
=
"1.
1
.0"
)
class
HandPoseModel
(
nn
.
Layer
):
"""
HandposeModel
...
...
modules/image/keypoint_detection/openpose_hands_estimation/readme.md
浏览文件 @
96baa2b8
...
...
@@ -154,8 +154,10 @@
初始发布
*
1.1.0
*
```shell
$ hub install hand_pose_localization==1.
0
.0
$ hub install hand_pose_localization==1.
1
.0
```
modules/image/keypoint_detection/openpose_hands_estimation/test.py
0 → 100644
浏览文件 @
96baa2b8
import
os
import
shutil
import
unittest
import
cv2
import
requests
import
paddlehub
as
hub
os
.
environ
[
'CUDA_VISIBLE_DEVICES'
]
=
'0'
class
TestHubModule
(
unittest
.
TestCase
):
@
classmethod
def
setUpClass
(
cls
)
->
None
:
img_url
=
'https://unsplash.com/photos/QUVLQPt37n0/download?ixid=MnwxMjA3fDB8MXxzZWFyY2h8M3x8cGVyc29uJTIwaGFuZHMlMjBoZWxsb3xlbnwwfHx8fDE2NjE4NjE1MzE&force=true&w=640'
if
not
os
.
path
.
exists
(
'tests'
):
os
.
makedirs
(
'tests'
)
response
=
requests
.
get
(
img_url
)
assert
response
.
status_code
==
200
,
'Network Error.'
with
open
(
'tests/test.jpg'
,
'wb'
)
as
f
:
f
.
write
(
response
.
content
)
cls
.
module
=
hub
.
Module
(
name
=
"openpose_hands_estimation"
)
@
classmethod
def
tearDownClass
(
cls
)
->
None
:
shutil
.
rmtree
(
'tests'
)
shutil
.
rmtree
(
'inference'
)
shutil
.
rmtree
(
'openpose_body'
)
shutil
.
rmtree
(
'openpose_hand'
)
def
test_predict1
(
self
):
results
=
self
.
module
.
predict
(
img
=
'tests/test.jpg'
,
visualization
=
False
)
kps
=
results
[
'all_hand_peaks'
][
0
].
tolist
()
self
.
assertIsInstance
(
kps
,
list
)
def
test_predict2
(
self
):
results
=
self
.
module
.
predict
(
img
=
cv2
.
imread
(
'tests/test.jpg'
),
visualization
=
False
)
kps
=
results
[
'all_hand_peaks'
][
0
].
tolist
()
self
.
assertIsInstance
(
kps
,
list
)
def
test_predict3
(
self
):
results
=
self
.
module
.
predict
(
img
=
cv2
.
imread
(
'tests/test.jpg'
),
visualization
=
True
)
kps
=
results
[
'all_hand_peaks'
][
0
].
tolist
()
self
.
assertIsInstance
(
kps
,
list
)
def
test_predict4
(
self
):
self
.
assertRaises
(
AttributeError
,
self
.
module
.
predict
,
img
=
'no.jpg'
)
def
test_predict5
(
self
):
self
.
assertRaises
(
AttributeError
,
self
.
module
.
predict
,
img
=
[
'test.jpg'
]
)
def
test_save_inference_model
(
self
):
self
.
module
.
save_inference_model
(
'./inference/model'
)
self
.
assertTrue
(
os
.
path
.
exists
(
'./inference/model/openpose_hands_estimation.pdmodel'
))
self
.
assertTrue
(
os
.
path
.
exists
(
'./inference/model/openpose_hands_estimation.pdiparams'
))
if
__name__
==
"__main__"
:
unittest
.
main
()
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录