From 87b9d564ad761fe7db7a8ca47a676ecac6f7c3df Mon Sep 17 00:00:00 2001 From: zhiboniu <31800336+zhiboniu@users.noreply.github.com> Date: Fri, 25 Mar 2022 15:38:40 +0800 Subject: [PATCH] fix datacollector error without reid;test=document_fix (#5459) --- deploy/pphuman/datacollector.py | 3 ++- deploy/pphuman/pipeline.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/deploy/pphuman/datacollector.py b/deploy/pphuman/datacollector.py index 62bd68bfc..8dfef12db 100644 --- a/deploy/pphuman/datacollector.py +++ b/deploy/pphuman/datacollector.py @@ -75,7 +75,8 @@ class DataCollector(object): action_res = Result.get('action') reid_res = Result.get('reid') - for idx, mot_item in enumerate(reid_res['rects']): + rects = reid_res['rects'] if reid_res is not None else mot_res['boxes'] + for idx, mot_item in enumerate(rects): ids = int(mot_item[0]) if ids not in self.collector: self.collector[ids] = copy.deepcopy(self.mots) diff --git a/deploy/pphuman/pipeline.py b/deploy/pphuman/pipeline.py index bbbf4da95..2090b2a0c 100644 --- a/deploy/pphuman/pipeline.py +++ b/deploy/pphuman/pipeline.py @@ -460,8 +460,9 @@ class PipePredictor(object): # nothing detected if len(mot_res['boxes']) == 0: frame_id += 1 - self.pipe_timer.img_num += 1 - self.pipe_timer.total_time.end() + if frame_id > self.warmup_frame: + self.pipe_timer.img_num += 1 + self.pipe_timer.total_time.end() if self.cfg['visual']: _, _, fps = self.pipe_timer.get_total_time() im = self.visualize_video(frame, mot_res, frame_id, -- GitLab