Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
e6324fd5
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
e6324fd5
编写于
2月 28, 2023
作者:
Z
zhiboniu
提交者:
GitHub
2月 28, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adapted between higherhrnet and petr (#7840)
* new adapted * test ok
上级
bec57bcf
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
33 addition
and
16 deletion
+33
-16
configs/keypoint/higherhrnet/higherhrnet_hrnet_w32_512.yml
configs/keypoint/higherhrnet/higherhrnet_hrnet_w32_512.yml
+7
-1
configs/keypoint/higherhrnet/higherhrnet_hrnet_w32_512_swahr.yml
.../keypoint/higherhrnet/higherhrnet_hrnet_w32_512_swahr.yml
+7
-1
configs/keypoint/higherhrnet/higherhrnet_hrnet_w32_640.yml
configs/keypoint/higherhrnet/higherhrnet_hrnet_w32_640.yml
+8
-2
configs/keypoint/petr/petr_resnet50_16x2_coco.yml
configs/keypoint/petr/petr_resnet50_16x2_coco.yml
+1
-2
ppdet/data/transform/keypoint_operators.py
ppdet/data/transform/keypoint_operators.py
+9
-9
ppdet/utils/visualizer.py
ppdet/utils/visualizer.py
+1
-1
未找到文件。
configs/keypoint/higherhrnet/higherhrnet_hrnet_w32_512.yml
浏览文件 @
e6324fd5
...
...
@@ -66,6 +66,9 @@ TrainDataset:
anno_path
:
annotations/person_keypoints_train2017.json
dataset_dir
:
dataset/coco
num_joints
:
*num_joints
return_bbox
:
False
return_area
:
False
return_class
:
False
EvalDataset
:
!KeypointBottomUpCocoDataset
...
...
@@ -74,6 +77,9 @@ EvalDataset:
dataset_dir
:
dataset/coco
num_joints
:
*num_joints
test_mode
:
true
return_bbox
:
False
return_area
:
False
return_class
:
False
TestDataset
:
!ImageFolder
...
...
@@ -88,7 +94,7 @@ TrainReader:
max_degree
:
30
scale
:
[
0.75
,
1.5
]
max_shift
:
0.2
trainsize
:
*input_size
trainsize
:
[
*input_size
,
*input_size
]
hmsize
:
[
*hm_size
,
*hm_size_2x
]
-
KeyPointFlip
:
flip_prob
:
0.5
...
...
configs/keypoint/higherhrnet/higherhrnet_hrnet_w32_512_swahr.yml
浏览文件 @
e6324fd5
...
...
@@ -67,6 +67,9 @@ TrainDataset:
anno_path
:
annotations/person_keypoints_train2017.json
dataset_dir
:
dataset/coco
num_joints
:
*num_joints
return_bbox
:
False
return_area
:
False
return_class
:
False
EvalDataset
:
!KeypointBottomUpCocoDataset
...
...
@@ -75,6 +78,9 @@ EvalDataset:
dataset_dir
:
dataset/coco
num_joints
:
*num_joints
test_mode
:
true
return_bbox
:
False
return_area
:
False
return_class
:
False
TestDataset
:
!ImageFolder
...
...
@@ -89,7 +95,7 @@ TrainReader:
max_degree
:
30
scale
:
[
0.75
,
1.5
]
max_shift
:
0.2
trainsize
:
*input_size
trainsize
:
[
*input_size
,
*input_size
]
hmsize
:
[
*hm_size
,
*hm_size_2x
]
-
KeyPointFlip
:
flip_prob
:
0.5
...
...
configs/keypoint/higherhrnet/higherhrnet_hrnet_w32_640.yml
浏览文件 @
e6324fd5
...
...
@@ -66,6 +66,9 @@ TrainDataset:
anno_path
:
annotations/person_keypoints_train2017.json
dataset_dir
:
dataset/coco
num_joints
:
*num_joints
return_bbox
:
False
return_area
:
False
return_class
:
False
EvalDataset
:
!KeypointBottomUpCocoDataset
...
...
@@ -74,12 +77,15 @@ EvalDataset:
dataset_dir
:
dataset/coco
num_joints
:
*num_joints
test_mode
:
true
return_bbox
:
False
return_area
:
False
return_class
:
False
TestDataset
:
!ImageFolder
anno_path
:
dataset/coco/keypoint_imagelist.txt
worker_num
:
0
worker_num
:
8
global_mean
:
&global_mean
[
0.485
,
0.456
,
0.406
]
global_std
:
&global_std
[
0.229
,
0.224
,
0.225
]
TrainReader
:
...
...
@@ -88,7 +94,7 @@ TrainReader:
max_degree
:
30
scale
:
[
0.75
,
1.5
]
max_shift
:
0.2
trainsize
:
*input_size
trainsize
:
[
*input_size
,
*input_size
]
hmsize
:
[
*hm_size
,
*hm_size_2x
]
-
KeyPointFlip
:
flip_prob
:
0.5
...
...
configs/keypoint/petr/petr_resnet50_16x2_coco.yml
浏览文件 @
e6324fd5
...
...
@@ -245,8 +245,7 @@ EvalReader:
TestReader
:
sample_transforms
:
-
Decode
:
{}
-
EvalAffine
:
size
:
*trainsize
-
EvalAffine
:
{
size
:
800
}
-
NormalizeImage
:
mean
:
*global_mean
std
:
*global_std
...
...
ppdet/data/transform/keypoint_operators.py
浏览文件 @
e6324fd5
...
...
@@ -76,7 +76,7 @@ class KeyPointFlip(object):
'''
records['gt_joints'] is Sequence in higherhrnet
'''
if
not
(
'gt_joints'
in
records
and
records
[
'gt_joints'
].
size
>
0
):
if
not
(
'gt_joints'
in
records
and
len
(
records
[
'gt_joints'
])
>
0
):
return
records
kpts_lst
=
records
[
'gt_joints'
]
...
...
@@ -147,7 +147,7 @@ class RandomAffine(object):
max_scale (list[2]): the scale range to apply, transform range is [min, max]
max_shift (float): the max abslute shift ratio to apply, transform range is [-max_shift*imagesize, max_shift*imagesize]
hmsize (list[2]): output heatmap's shape list of different scale outputs of higherhrnet
trainsize (
int
): the standard length used to train, the 'scale_type' of [h,w] will be resize to trainsize for standard
trainsize (
list[2]
): the standard length used to train, the 'scale_type' of [h,w] will be resize to trainsize for standard
scale_type (str): the length of [h,w] to used for trainsize, chosed between 'short' and 'long'
records(dict): the dict contained the image, mask and coords
...
...
@@ -161,7 +161,7 @@ class RandomAffine(object):
scale
=
[
0.75
,
1.5
],
max_shift
=
0.2
,
hmsize
=
None
,
trainsize
=
512
,
trainsize
=
[
512
,
512
]
,
scale_type
=
'short'
,
boldervalue
=
[
114
,
114
,
114
]):
super
(
RandomAffine
,
self
).
__init__
()
...
...
@@ -304,7 +304,7 @@ class RandomAffine(object):
input_size
=
2
*
center
if
self
.
trainsize
!=
-
1
:
dsize
=
self
.
trainsize
imgshape
=
(
dsize
,
dsize
)
imgshape
=
(
dsize
)
else
:
dsize
=
scale
imgshape
=
(
shape
.
tolist
())
...
...
@@ -379,6 +379,7 @@ class EvalAffine(object):
if
'gt_joints'
in
records
:
del
records
[
'gt_joints'
]
records
[
'image'
]
=
image_resized
records
[
'scale_factor'
]
=
self
.
size
/
min
(
h
,
w
)
return
records
...
...
@@ -1574,14 +1575,13 @@ class PETR_Resize:
dict: Resized results, 'im_shape', 'pad_shape', 'scale_factor',
\
'keep_ratio' keys are added into result dict.
"""
if
'scale'
not
in
results
:
if
'scale_factor'
in
results
:
img_shape
=
results
[
'image'
].
shape
[:
2
]
scale_factor
=
results
[
'scale_factor'
]
assert
isinstance
(
scale_factor
,
float
)
results
[
'scale'
]
=
tuple
(
[
int
(
x
*
scale_factor
)
for
x
in
img_shape
][::
-
1
])
scale_factor
=
results
[
'scale_factor'
]
[
0
]
#
assert isinstance(scale_factor, float)
results
[
'scale'
]
=
[
int
(
x
*
scale_factor
)
for
x
in
img_shape
][::
-
1
]
else
:
self
.
_random_scale
(
results
)
else
:
...
...
ppdet/utils/visualizer.py
浏览文件 @
e6324fd5
...
...
@@ -238,7 +238,7 @@ def draw_pose(image,
'for example: `pip install matplotlib`.'
)
raise
e
skeletons
=
np
.
array
([
item
[
'keypoints'
]
for
item
in
results
])
.
reshape
((
-
1
,
51
))
skeletons
=
np
.
array
([
item
[
'keypoints'
]
for
item
in
results
])
kpt_nums
=
17
if
len
(
skeletons
)
>
0
:
kpt_nums
=
int
(
skeletons
.
shape
[
1
]
/
3
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录