Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
86d24e9f
M
models
项目概览
PaddlePaddle
/
models
大约 1 年 前同步成功
通知
222
Star
6828
Fork
2962
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
602
列表
看板
标记
里程碑
合并请求
255
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
602
Issue
602
列表
看板
标记
里程碑
合并请求
255
合并请求
255
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
86d24e9f
编写于
4月 20, 2022
作者:
littletomatodonkey
提交者:
GitHub
4月 20, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix readme (#5503)
上级
38687970
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
18 deletion
+22
-18
tutorials/pp-series/HRNet-Keypoint/README.md
tutorials/pp-series/HRNet-Keypoint/README.md
+18
-14
tutorials/pp-series/HRNet-Keypoint/deploy/infer.py
tutorials/pp-series/HRNet-Keypoint/deploy/infer.py
+3
-4
tutorials/pp-series/HRNet-Keypoint/deploy/visualize.py
tutorials/pp-series/HRNet-Keypoint/deploy/visualize.py
+1
-0
未找到文件。
tutorials/pp-series/HRNet-Keypoint/README.md
浏览文件 @
86d24e9f
...
...
@@ -39,7 +39,7 @@ python -c "import paddle; print(paddle.__version__)"
**Note**
1.
If you want to
use PaddleDetection
on multi-GPU, please install NCCL at first.
1.
If you want to
train the model
on multi-GPU, please install NCCL at first.
#### 2. Clone this repo, and we'll call the directory that you cloned as ${POSE_ROOT}.
#### 3. Install dependencies:
...
...
@@ -113,10 +113,10 @@ python -m paddle.distributed.launch --gpus 0,1,2,3,4,5,6,7 tools/train.py -c con
# GPU evaluation
export
CUDA_VISIBLE_DEVICES
=
0
python tools/eval.py
-c
configs/hrnet_w32_256x192.yml
-o
weights
=
https://paddle
det.bj.bcebos.com/models/keypoint
/hrnet_w32_256x192.pdparams
python tools/eval.py
-c
configs/hrnet_w32_256x192.yml
-o
weights
=
https://paddle
-model-ecology.bj.bcebos.com/model/hrnet_pose
/hrnet_w32_256x192.pdparams
# test
python tools/infer.py
-c
configs/hrnet_w32_256x192.yml
--infer_img
=
dataset/test_image/hrnet_demo.jpg
-o
weights
=
https://paddle
det.bj.bcebos.com/models/keypoint
/hrnet_w32_256x192.pdparams
python tools/infer.py
-c
configs/hrnet_w32_256x192.yml
--infer_img
=
dataset/test_image/hrnet_demo.jpg
-o
weights
=
https://paddle
-model-ecology.bj.bcebos.com/model/hrnet_pose
/hrnet_w32_256x192.pdparams
# training with distillation
python tools/train.py
-c
configs/lite_hrnet_30_256x192_coco.yml
--distill_config
=
./configs/hrnet_w32_256x192_teacher.yml
...
...
@@ -131,11 +131,11 @@ python -m paddle.distributed.launch --gpus 0,1,2,3,4,5,6,7 tools/train.py -c con
# GPU evaluation with PACT quantization
export
CUDA_VISIBLE_DEVICES
=
0
python tools/eval.py
-c
configs/lite_hrnet_30_256x192_coco_pact.yml
-o
weights
=
https://paddle
det.bj.bcebos.com/models/keypoint
/lite_hrnet_30_256x192_coco_pact.pdparams
python tools/eval.py
-c
configs/lite_hrnet_30_256x192_coco_pact.yml
-o
weights
=
https://paddle
-model-ecology.bj.bcebos.com/model/hrnet_pose
/lite_hrnet_30_256x192_coco_pact.pdparams
# test with PACT quantization
python tools/infer.py
-c
configs/lite_hrnet_30_256x192_coco_pact.yml
--infer_img
=
dataset/test_image/hrnet_demo.jpg
-o
weights
=
https://paddle
det.bj.bcebos.com/models/keypoint/lite_hrnet_30_256x192_coco_pact
.pdparams
--infer_img
=
dataset/test_image/hrnet_demo.jpg
-o
weights
=
https://paddle
-model-ecology.bj.bcebos.com/model/hrnet_pose/lite_hrnet_30_256x192_coco
.pdparams
```
...
...
@@ -143,19 +143,19 @@ python tools/infer.py -c configs/lite_hrnet_30_256x192_coco_pact.yml
```
bash
# export model
python tools/export_model.py
-c
configs/hrnet_w32_256x192.yml
-o
weights
=
https://paddle
det.bj.bcebos.com/models/keypoint/hrnet_w32_256x192_coco
.pdparams
python tools/export_model.py
-c
configs/hrnet_w32_256x192.yml
-o
weights
=
https://paddle
-model-ecology.bj.bcebos.com/model/hrnet_pose/hrnet_w32_256x192
.pdparams
# inference
python deploy/infer.py
--model_dir
=
output_inference/hrnet_w32_256x192/
--image_file
=
dataset/test_image/hrnet_demo.jpg
# export model with lite model
python tools/export_model.py
-c
configs/lite_hrnet_30_256x192_coco.yml
-o
weights
=
https://paddle
det.bj.bcebos.com/models/keypoint
/lite_hrnet_30_256x192_coco.pdparams
python tools/export_model.py
-c
configs/lite_hrnet_30_256x192_coco.yml
-o
weights
=
https://paddle
-model-ecology.bj.bcebos.com/model/hrnet_pose
/lite_hrnet_30_256x192_coco.pdparams
# inference with lite model
python deploy/infer.py
--model_dir
=
output_inference/lite_hrnet_30_256x192_coco/
--image_file
=
dataset/test_image/hrnet_demo.jpg
# export model with PACT quantization
python tools/export_model.py
-c
configs/lite_hrnet_30_256x192_coco_pact.yml
-o
weights
=
https://paddle
det.bj.bcebos.com/models/keypoint
/lite_hrnet_30_256x192_coco_pact.pdparams
python tools/export_model.py
-c
configs/lite_hrnet_30_256x192_coco_pact.yml
-o
weights
=
https://paddle
-model-ecology.bj.bcebos.com/model/hrnet_pose
/lite_hrnet_30_256x192_coco_pact.pdparams
# inference with PACT quantization
python deploy/infer.py
--model_dir
=
output_inference/lite_hrnet_30_256x192_coco_pact/
--image_file
=
dataset/test_image/hrnet_demo.jpg
...
...
@@ -164,12 +164,16 @@ python deploy/infer.py --model_dir=output_inference/lite_hrnet_30_256x192_coco_
## 3 Result
COCO Dataset
| Model | Input Size | AP(coco val) | Model Download | Config File |
| :---------------- | -------- | :----------: | :----------------------------------------------------------: | ----------------------------------------------------------- |
| HRNet-w32 | 256x192 | 76.9 |
[
hrnet_w32_256x192.pdparams
](
https://paddle-model-ecology.bj.bcebos.com/model/hrnet_pose/hrnet_w32_256x192.pdparams
)
|
[
config
](
./configs/hrnet_w32_256x192.yml
)
|
| LiteHRNet-30 | 256x192 | 69.4 |
[
lite_hrnet_30_256x192_coco.pdparams
](
https://paddle-model-ecology.bj.bcebos.com/model/hrnet_pose/lite_hrnet_30_256x192_coco.pdparams
)
|
[
config
](
./configs/lite_hrnet_30_256x192_coco.yml
)
|
| LiteHRNet-30-PACT | 256x192 | 68.9 |
[
lite_hrnet_30_256x192_coco_pact.pdparams
](
https://paddle-model-ecology.bj.bcebos.com/model/hrnet_pose/lite_hrnet_30_256x192_coco_pact.pdparams
)
|
[
config
](
./configs/lite_hrnet_30_256x192_coco_pact.yml
)
|
| LiteHRNet-30-PACT | 256x192 | 69.9 |
[
lite_hrnet_30_256x192_coco.pdparams
](
https://paddle-model-ecology.bj.bcebos.com/model/hrnet_pose/lite_hrnet_30_256x192_coco_dist.pdparams
)
|
[
config
](
./configs/lite_hrnet_30_256x192_coco_pact.yml
)
|
| Model | Input Size | AP(%, coco val) | Model Download | Config File | Inference model size |
| :----------: | -------- | :----------: | :------------: | :---: | :---: |
| HRNet-w32 | 256x192 | 76.9 |
[
hrnet_w32_256x192.pdparams
](
https://paddle-model-ecology.bj.bcebos.com/model/hrnet_pose/hrnet_w32_256x192.pdparams
)
|
[
config
](
./configs/hrnet_w32_256x192.yml
)
| 118M |
| LiteHRNet-30 | 256x192 | 69.4 |
[
lite_hrnet_30_256x192_coco.pdparams
](
https://paddle-model-ecology.bj.bcebos.com/model/hrnet_pose/lite_hrnet_30_256x192_coco.pdparams
)
|
[
config
](
./configs/lite_hrnet_30_256x192_coco.yml
)
| 26M |
| LiteHRNet-30-distillation | 256x192 | 69.9 |
[
lite_hrnet_30_256x192_coco_dist.pdparams
](
https://paddle-model-ecology.bj.bcebos.com/model/hrnet_pose/lite_hrnet_30_256x192_coco_dist.pdparams
)
|
[
config
](
./configs/lite_hrnet_30_256x192_coco.yml
)
| 26M |
| LiteHRNet-30-PACT | 256x192 | 68.9 |
[
lite_hrnet_30_256x192_coco_pact.pdparams
](
https://paddle-model-ecology.bj.bcebos.com/model/hrnet_pose/lite_hrnet_30_256x192_coco_pact.pdparams
)
|
[
config
](
./configs/lite_hrnet_30_256x192_coco_pact.yml
)
| 8.0M |
*
note: Inference model size is obtained by summing
`pdiparams`
and
`pdmodel`
file size.
![](
/dataset/test_image/hrnet_demo.jpg
)
...
...
tutorials/pp-series/HRNet-Keypoint/deploy/infer.py
浏览文件 @
86d24e9f
...
...
@@ -335,10 +335,10 @@ def predict_image(detector, image_list, batch_size=1):
if
FLAGS
.
run_benchmark
:
# warmup
detector
.
predict
(
image_list
,
FLAGS
.
threshold
,
repeats
=
10
,
add_timer
=
False
)
image_list
,
FLAGS
.
threshold
,
repeats
=
3
,
add_timer
=
False
)
# run benchmark
detector
.
predict
(
image_list
,
FLAGS
.
threshold
,
repeats
=
10
,
add_timer
=
True
)
image_list
,
FLAGS
.
threshold
,
repeats
=
3
,
add_timer
=
True
)
cm
,
gm
,
gu
=
get_current_memory_mb
()
detector
.
cpu_mem
+=
cm
...
...
@@ -447,8 +447,7 @@ if __name__ == '__main__':
FLAGS
=
parser
.
parse_args
()
print_arguments
(
FLAGS
)
FLAGS
.
device
=
FLAGS
.
device
.
upper
()
assert
FLAGS
.
device
in
[
'CPU'
,
'GPU'
,
'XPU'
],
"device should be CPU, GPU or XPU"
assert
FLAGS
.
device
in
[
'CPU'
,
'GPU'
],
"device should be CPU or GPU"
assert
not
FLAGS
.
use_gpu
,
"use_gpu has been deprecated, please use --device"
main
()
tutorials/pp-series/HRNet-Keypoint/deploy/visualize.py
浏览文件 @
86d24e9f
...
...
@@ -129,6 +129,7 @@ def draw_pose(imgfile,
canvas
=
cv2
.
addWeighted
(
canvas
,
0.4
,
cur_canvas
,
0.6
,
0
)
if
returnimg
:
return
canvas
os
.
makedirs
(
save_dir
,
exist_ok
=
True
)
save_name
=
os
.
path
.
join
(
save_dir
,
os
.
path
.
splitext
(
os
.
path
.
basename
(
imgfile
))[
0
]
+
'_vis.jpg'
)
plt
.
imsave
(
save_name
,
canvas
[:,
:,
::
-
1
])
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录