From 4b1e40309c24d99b8b1139b4b3210f4b48c79803 Mon Sep 17 00:00:00 2001 From: zhiboniu <31800336+zhiboniu@users.noreply.github.com> Date: Tue, 27 Jul 2021 10:17:09 +0800 Subject: [PATCH] change dark_w32_384x288 batchsize to 32; modify np.pad to support lower numpy version (#3786) --- configs/keypoint/hrnet/dark_hrnet_w32_384x288.yml | 2 +- deploy/python/keypoint_postprocess.py | 1 + ppdet/modeling/architectures/keypoint_hrhrnet.py | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/configs/keypoint/hrnet/dark_hrnet_w32_384x288.yml b/configs/keypoint/hrnet/dark_hrnet_w32_384x288.yml index ec9608f72..f9ba19cf9 100644 --- a/configs/keypoint/hrnet/dark_hrnet_w32_384x288.yml +++ b/configs/keypoint/hrnet/dark_hrnet_w32_384x288.yml @@ -111,7 +111,7 @@ TrainReader: std: *global_std is_scale: true - Permute: {} - batch_size: 64 + batch_size: 32 shuffle: true drop_last: false diff --git a/deploy/python/keypoint_postprocess.py b/deploy/python/keypoint_postprocess.py index cd9b92895..19364bf46 100644 --- a/deploy/python/keypoint_postprocess.py +++ b/deploy/python/keypoint_postprocess.py @@ -106,6 +106,7 @@ class HrHRNetPostProcess(object): # 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): diff --git a/ppdet/modeling/architectures/keypoint_hrhrnet.py b/ppdet/modeling/architectures/keypoint_hrhrnet.py index df7ace682..6f62b4b21 100644 --- a/ppdet/modeling/architectures/keypoint_hrhrnet.py +++ b/ppdet/modeling/architectures/keypoint_hrhrnet.py @@ -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, @@ -224,6 +224,7 @@ class HrHRNetPostProcess(object): # 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): -- GitLab