From d5ae73f0c370fdbc1eebbca769c9a14b01cffd08 Mon Sep 17 00:00:00 2001 From: zhiboniu Date: Tue, 31 May 2022 11:49:30 +0000 Subject: [PATCH] add standard actions --- deploy/pphuman/config/infer_cfg.yml | 15 ++++++++++++ deploy/pphuman/pipeline.py | 36 +++++++++++++++++++++++++---- 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/deploy/pphuman/config/infer_cfg.yml b/deploy/pphuman/config/infer_cfg.yml index 4ef23a230..79ab94747 100644 --- a/deploy/pphuman/config/infer_cfg.yml +++ b/deploy/pphuman/config/infer_cfg.yml @@ -24,6 +24,11 @@ ATTR: basemode: "idbased" enable: False +VIDEO_ACTION: + model_dir: output_inference/pp-stm + batch_size: 1 + enable: False + SKELETON_ACTION: model_dir: output_inference/STGCN batch_size: 1 @@ -33,6 +38,16 @@ SKELETON_ACTION: basemode: "skeletonbased" enable: False +ID_BASED_DETACTION: + model_dir: output_inference/detector + batch_size: 1 + enable: False + +ID_BASED_CLSACTION: + model_dir: output_inference/classification + batch_size: 1 + enable: False + REID: model_dir: output_inference/reid_model/ batch_size: 16 diff --git a/deploy/pphuman/pipeline.py b/deploy/pphuman/pipeline.py index eb67a26bd..47209f13a 100644 --- a/deploy/pphuman/pipeline.py +++ b/deploy/pphuman/pipeline.py @@ -266,12 +266,27 @@ class PipePredictor(object): self.with_skeleton_action = cfg.get( 'SKELETON_ACTION', False)['enable'] if cfg.get('SKELETON_ACTION', False) else False + self.with_video_action = cfg.get( + 'VIDEO_ACTION', False)['enable'] if cfg.get('VIDEO_ACTION', + False) else False + self.with_idbased_detaction = cfg.get( + 'ID_BASED_DETACTION', False)['enable'] if cfg.get( + 'ID_BASED_DETACTION', False) else False + self.with_idbased_clsaction = cfg.get( + 'ID_BASED_CLSACTION', False)['enable'] if cfg.get( + 'ID_BASED_CLSACTION', False) else False self.with_mtmct = cfg.get('REID', False)['enable'] if cfg.get( 'REID', False) else False if self.with_attr: print('Attribute Recognition enabled') if self.with_skeleton_action: print('SkeletonAction Recognition enabled') + if self.with_video_action: + print('VideoAction Recognition enabled') + if self.with_idbased_detaction: + print('IDBASED Detection Action Recognition enabled') + if self.with_idbased_clsaction: + print('IDBASED Classification Action Recognition enabled') if self.with_mtmct: print("MTMCT enabled") @@ -547,6 +562,7 @@ class PipePredictor(object): self.pipeline_res.update(mot_res, 'mot') if self.with_attr or self.with_skeleton_action: + #todo: move this code to each class's predeal function crop_input, new_bboxes, ori_bboxes = crop_image_with_mot( frame, mot_res) @@ -559,6 +575,18 @@ class PipePredictor(object): self.pipe_timer.module_time['attr'].end() self.pipeline_res.update(attr_res, 'attr') + if self.with_idbased_detaction: + #predeal, get what your model need + #predict, model preprocess\run\postprocess + #postdeal, interact with pipeline + pass + + if self.with_idbased_clsaction: + #predeal, get what your model need + #predict, model preprocess\run\postprocess + #postdeal, interact with pipeline + pass + if self.with_skeleton_action: if self.modebase["skeletonbased"]: if frame_id > self.warmup_frame: @@ -621,10 +649,10 @@ class PipePredictor(object): else: self.pipeline_res.clear('reid') - if self.modebase["videobased"]: - pass - - if self.modebase["framebased"]: + if self.with_video_action: + #predeal, get what your model need + #predict, model preprocess\run\postprocess + #postdeal, interact with pipeline pass self.collector.append(frame_id, self.pipeline_res) -- GitLab