Skip to content

Commit

Permalink
change dark_w32_384x288 batchsize to 32; modify np.pad to support low…
Browse files Browse the repository at this point in the history
…er numpy version (PaddlePaddle#3788)
  • Loading branch information
zhiboniu authored Jul 26, 2021
1 parent 40436c8 commit 0f2e9a5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configs/keypoint/hrnet/dark_hrnet_w32_384x288.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ TrainReader:
std: *global_std
is_scale: true
- Permute: {}
batch_size: 64
batch_size: 32
shuffle: true
drop_last: false

Expand Down
1 change: 1 addition & 0 deletions deploy/python/keypoint_postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def __call__(self, heatmap, tagmap, heat_k, inds_k, original_height,
# pad the cost matrix, otherwise new pose are ignored
if num_valid > num_clusters:
cost = np.pad(cost, ((0, 0), (0, num_valid - num_clusters)),
'constant',
constant_values=((0, 0), (0, 1e-10)))
rows, cols = linear_sum_assignment(cost)
for y, x in zip(rows, cols):
Expand Down
3 changes: 2 additions & 1 deletion ppdet/modeling/architectures/keypoint_hrhrnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class HigherHRNet(BaseArch):

def __init__(self,
backbone='HRNet',
hrhrnet_head='HigherHRNetHead',
hrhrnet_head='HrHRNetHead',
post_process='HrHRNetPostProcess',
eval_flip=True,
flip_perm=None,
Expand Down Expand Up @@ -224,6 +224,7 @@ def __call__(self, heatmap, tagmap, heat_k, inds_k, original_height,
# pad the cost matrix, otherwise new pose are ignored
if num_valid > num_clusters:
cost = np.pad(cost, ((0, 0), (0, num_valid - num_clusters)),
'constant',
constant_values=((0, 0), (0, 1e-10)))
rows, cols = linear_sum_assignment(cost)
for y, x in zip(rows, cols):
Expand Down

0 comments on commit 0f2e9a5

Please sign in to comment.