From 4f05f2f9f54aaeadc15aff63d693fc6873e069a6 Mon Sep 17 00:00:00 2001 From: JYChen Date: Thu, 31 Mar 2022 10:32:11 +0800 Subject: [PATCH] [Cherry-Pick] fix data collector error (#5534) * fix data collector error * change List to Tuple to adapt different cv version * fix reid model_dir set --- deploy/pphuman/datacollector.py | 2 +- deploy/pphuman/pipe_utils.py | 2 +- deploy/pphuman/reid.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/pphuman/datacollector.py b/deploy/pphuman/datacollector.py index f1e3a2136..6bf4fee85 100644 --- a/deploy/pphuman/datacollector.py +++ b/deploy/pphuman/datacollector.py @@ -90,7 +90,7 @@ class DataCollector(object): if kpt_res: self.collector[ids]["kpts"].append( [kpt_res['keypoint'][0][idx], kpt_res['keypoint'][1][idx]]) - if action_res: + if action_res and (idx + 1) in action_res: self.collector[ids]["actions"].append(action_res[idx + 1]) else: # action model generate result per X frames, Not available every frames diff --git a/deploy/pphuman/pipe_utils.py b/deploy/pphuman/pipe_utils.py index b55ac9a86..43904e657 100644 --- a/deploy/pphuman/pipe_utils.py +++ b/deploy/pphuman/pipe_utils.py @@ -217,7 +217,7 @@ class PipeTimer(Times): def merge_model_dir(args, model_dir): # set --model_dir DET=ppyoloe/ to overwrite the model_dir in config file - task_set = ['DET', 'ATTR', 'MOT', 'KPT', 'ACTION'] + task_set = ['DET', 'ATTR', 'MOT', 'KPT', 'ACTION', 'REID'] if not model_dir: return args for md in model_dir: diff --git a/deploy/pphuman/reid.py b/deploy/pphuman/reid.py index cef402923..3f4d59d78 100644 --- a/deploy/pphuman/reid.py +++ b/deploy/pphuman/reid.py @@ -73,7 +73,7 @@ class ReID(object): self.det_times = Timer() self.cpu_mem, self.gpu_mem, self.gpu_util = 0, 0, 0 self.batch_size = batch_size - self.input_wh = [128, 256] + self.input_wh = (128, 256) def set_config(self, model_dir): return PredictConfig(model_dir) -- GitLab