From 643f99ce1f8e2dd156d0223657ae78c405b67b16 Mon Sep 17 00:00:00 2001 From: LokeZhou Date: Tue, 22 Nov 2022 17:15:18 +0800 Subject: [PATCH] fix PP-HumanV2 PP-Vehicle Single choice bug (#5645) --- modelcenter/PP-HumanV2/APP/pipeline/pipeline.py | 2 +- modelcenter/PP-Vehicle/APP/pipeline/pipeline.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/modelcenter/PP-HumanV2/APP/pipeline/pipeline.py b/modelcenter/PP-HumanV2/APP/pipeline/pipeline.py index c43fb34f..2aa69c8f 100644 --- a/modelcenter/PP-HumanV2/APP/pipeline/pipeline.py +++ b/modelcenter/PP-HumanV2/APP/pipeline/pipeline.py @@ -135,7 +135,7 @@ def get_model_dir_with_list(cfg, args): cfg[key]["rec_model_dir"] = rec_model_dir print("rec_model_dir model dir: ", rec_model_dir) - if key == 'ID_BASED_DETACTION' or key == 'SKELETON_ACTION' or key == 'ATTR' or key =='ID_BASED_CLSACTION' or key=='REID': + if (key == 'ID_BASED_DETACTION' and (key in activate_list)) or (key == 'SKELETON_ACTION' and (key in activate_list))or (key == 'ATTR' and (key in activate_list)) or (key =='ID_BASED_CLSACTION' and (key in activate_list)) or (key=='REID' and (key in activate_list)): model_dir = cfg['MOT']["model_dir"] downloaded_model_dir = auto_download_model(model_dir) if downloaded_model_dir: diff --git a/modelcenter/PP-Vehicle/APP/pipeline/pipeline.py b/modelcenter/PP-Vehicle/APP/pipeline/pipeline.py index f883734d..124a8a6d 100644 --- a/modelcenter/PP-Vehicle/APP/pipeline/pipeline.py +++ b/modelcenter/PP-Vehicle/APP/pipeline/pipeline.py @@ -133,13 +133,12 @@ def get_model_dir_with_list(cfg, args): cfg[key]["rec_model_dir"] = rec_model_dir print("rec_model_dir model dir: ", rec_model_dir) - elif key == "MOT" and ( - key in activate_list): # for idbased and skeletonbased actions - model_dir = cfg[key]["model_dir"] + if (key == "MOT" and (key in activate_list)) or (key == "VEHICLE_PLATE" and (key in activate_list)) or (key == "VEHICLE_ATTR" and (key in activate_list)): # for idbased and skeletonbased actions + model_dir = cfg["MOT"]["model_dir"] downloaded_model_dir = auto_download_model(model_dir) if downloaded_model_dir: model_dir = downloaded_model_dir - cfg[key]["model_dir"] = model_dir + cfg["MOT"]["model_dir"] = model_dir print("mot_model_dir model_dir: ", model_dir) @@ -219,10 +218,12 @@ class PipePredictor(object): # only for ppvehicle self.with_vehicleplate = True if 'VEHICLE_PLATE' in activate_list else False if self.with_vehicleplate: + self.with_mot = True print('Vehicle Plate Recognition enabled') self.with_vehicle_attr = True if 'VEHICLE_ATTR' in activate_list else False if self.with_vehicle_attr: + self.with_mot = True print('Vehicle Attribute Recognition enabled') self.modebase = { -- GitLab