From 07f5f782def5a2ce1a29d23f99657ddd613418bc Mon Sep 17 00:00:00 2001 From: zhiboniu Date: Thu, 30 Jun 2022 08:53:07 +0000 Subject: [PATCH] update review --- deploy/cpp/src/keypoint_postprocess.cc | 2 -- deploy/python/det_keypoint_unite_infer.py | 6 +++--- deploy/python/det_keypoint_unite_utils.py | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/deploy/cpp/src/keypoint_postprocess.cc b/deploy/cpp/src/keypoint_postprocess.cc index 4cb53d8aa..eb692b0a7 100644 --- a/deploy/cpp/src/keypoint_postprocess.cc +++ b/deploy/cpp/src/keypoint_postprocess.cc @@ -300,8 +300,6 @@ float PoseSmooth::OneEuroFilter(float x_cur, float x_pre, int loc) { float fc = this->fc_min + this->beta * abs(dx_cur_hat); this->alpha = this->smoothing_factor(te, fc); float x_cur_hat = this->ExpSmoothing(x_cur, x_pre); - // printf("alpha:%f, x_cur:%f, x_pre:%f, x_cur_hat:%f\n", this->alpha, x_cur, - // x_pre, x_cur_hat); this->x_prev_hat.keypoints[loc] = x_cur_hat; this->dx_prev_hat.keypoints[loc] = dx_cur_hat; return x_cur_hat; diff --git a/deploy/python/det_keypoint_unite_infer.py b/deploy/python/det_keypoint_unite_infer.py index 62d3b82f4..f0b80752e 100644 --- a/deploy/python/det_keypoint_unite_infer.py +++ b/deploy/python/det_keypoint_unite_infer.py @@ -165,7 +165,7 @@ def topdown_unite_predict_video(detector, frame2, results, topdown_keypoint_detector, keypoint_batch_size, FLAGS.run_benchmark) - if FLAGS.smooth: + if FLAGS.smooth and len(keypoint_res['keypoint'][0])==1: current_keypoints = np.array(keypoint_res['keypoint'][0][0]) smooth_keypoints = keypoint_smoothing.smooth_process( current_keypoints) @@ -231,9 +231,9 @@ class KeypointSmoothing(object): self.fc_min = fc_min self.beta = beta - if self.filter_type == 'one_euro': + if self.filter_type == 'OneEuro': self.smooth_func = self.one_euro_filter - elif self.filter_type == 'ema': + elif self.filter_type == 'EMA': self.smooth_func = self.exponential_smoothing else: raise ValueError('filter type must be one_euro or ema') diff --git a/deploy/python/det_keypoint_unite_utils.py b/deploy/python/det_keypoint_unite_utils.py index 129969df2..7de129512 100644 --- a/deploy/python/det_keypoint_unite_utils.py +++ b/deploy/python/det_keypoint_unite_utils.py @@ -135,7 +135,7 @@ def argsparser(): parser.add_argument( '--filter_type', type=str, - default='one_euro', - help='when set --smooth True, choose filter type you want to use, it can be one_euro or ema.' + default='OneEuro', + help='when set --smooth True, choose filter type you want to use, it can be [OneEuro] or [EMA].' ) return parser -- GitLab