diff --git a/deploy/pipeline/config/examples/infer_cfg_illegal_parking.yml b/deploy/pipeline/config/examples/infer_cfg_illegal_parking.yml index 18c2915fcfe0921ae8d43ffebb4499ea15b60e49..a8e7d85d4255fcff3ac31cfc329c854e4b3dd180 100644 --- a/deploy/pipeline/config/examples/infer_cfg_illegal_parking.yml +++ b/deploy/pipeline/config/examples/infer_cfg_illegal_parking.yml @@ -10,7 +10,7 @@ MOT: VEHICLE_PLATE: det_model_dir: https://bj.bcebos.com/v1/paddledet/models/pipeline/ch_PP-OCRv3_det_infer.tar.gz - det_limit_side_len: 480 + det_limit_side_len: 736 det_limit_type: "max" rec_model_dir: https://bj.bcebos.com/v1/paddledet/models/pipeline/ch_PP-OCRv3_rec_infer.tar.gz rec_image_shape: [3, 48, 320] diff --git a/deploy/pipeline/config/examples/infer_cfg_vehicle_plate.yml b/deploy/pipeline/config/examples/infer_cfg_vehicle_plate.yml index 9f8d0740a8f41084f3fe37efced9d62227481bc3..bf745f9cc6546abcc450eac6bfc64965d7306a49 100644 --- a/deploy/pipeline/config/examples/infer_cfg_vehicle_plate.yml +++ b/deploy/pipeline/config/examples/infer_cfg_vehicle_plate.yml @@ -15,7 +15,7 @@ MOT: VEHICLE_PLATE: det_model_dir: https://bj.bcebos.com/v1/paddledet/models/pipeline/ch_PP-OCRv3_det_infer.tar.gz det_limit_side_len: 736 - det_limit_type: "min" + det_limit_type: "max" rec_model_dir: https://bj.bcebos.com/v1/paddledet/models/pipeline/ch_PP-OCRv3_rec_infer.tar.gz rec_image_shape: [3, 48, 320] rec_batch_num: 6 diff --git a/deploy/pipeline/config/infer_cfg_ppvehicle.yml b/deploy/pipeline/config/infer_cfg_ppvehicle.yml index 11880ebd54f962fa606861bf4eefe07ff9ca2cfe..fc4e2413c8baadcc538570fdba1b2bc194270b2c 100644 --- a/deploy/pipeline/config/infer_cfg_ppvehicle.yml +++ b/deploy/pipeline/config/infer_cfg_ppvehicle.yml @@ -15,7 +15,7 @@ MOT: VEHICLE_PLATE: det_model_dir: https://bj.bcebos.com/v1/paddledet/models/pipeline/ch_PP-OCRv3_det_infer.tar.gz det_limit_side_len: 736 - det_limit_type: "min" + det_limit_type: "max" rec_model_dir: https://bj.bcebos.com/v1/paddledet/models/pipeline/ch_PP-OCRv3_rec_infer.tar.gz rec_image_shape: [3, 48, 320] rec_batch_num: 6 diff --git a/deploy/pipeline/download.py b/deploy/pipeline/download.py index fd385e7ecd1c6ddaa086d2be63f861ee00ca731c..a166b3ba16587f866fc0b4822610ba9bbc43f433 100644 --- a/deploy/pipeline/download.py +++ b/deploy/pipeline/download.py @@ -36,6 +36,8 @@ MODEL_URL_MD5_DICT = { '64fa0e0701efd93c7db52a9b685b3de6', "https://bj.bcebos.com/v1/paddledet/models/pipeline/mot_ppyoloe_l_36e_ppvehicle.zip": "3859d1a26e0c498285c2374b1a347013", + "https://bj.bcebos.com/v1/paddledet/models/pipeline/mot_ppyoloe_s_36e_ppvehicle.zip": + "4ed58b546be2a76d8ccbb138f64874ac", "https://bj.bcebos.com/v1/paddledet/models/pipeline/dark_hrnet_w32_256x192.zip": "a20d5f6ca087bff0e9f2b18df45a36f2", "https://bj.bcebos.com/v1/paddledet/models/pipeline/PPLCNet_x1_0_person_attribute_945_infer.zip": diff --git a/deploy/pipeline/ppvehicle/vehicle_plate.py b/deploy/pipeline/ppvehicle/vehicle_plate.py index 954687fe1ca452760af883e4cbfef7d4ddfd2154..d1263793788a4d37a106f575c2829dd7991897ae 100644 --- a/deploy/pipeline/ppvehicle/vehicle_plate.py +++ b/deploy/pipeline/ppvehicle/vehicle_plate.py @@ -123,7 +123,6 @@ class PlateDetector(object): img, shape_list = self.preprocess(image) if img is None: return None, 0 - self.input_tensor.copy_from_cpu(img) self.predictor.run() outputs = [] diff --git a/deploy/pipeline/ppvehicle/vehicle_plateutils.py b/deploy/pipeline/ppvehicle/vehicle_plateutils.py index 431b647206fe4539f71d45350586dfdb51e2731c..4a7b792da37de9a1f9e394452cdd11a91b0a9b47 100644 --- a/deploy/pipeline/ppvehicle/vehicle_plateutils.py +++ b/deploy/pipeline/ppvehicle/vehicle_plateutils.py @@ -61,14 +61,13 @@ def create_predictor(args, cfg, mode): 'trt_fp32': inference.PrecisionType.Float32, 'trt_fp16': inference.PrecisionType.Half } + min_subgraph_size = 15 if args.run_mode in precision_map.keys(): config.enable_tensorrt_engine( workspace_size=(1 << 25) * batch_size, max_batch_size=batch_size, min_subgraph_size=min_subgraph_size, - precision_mode=precision_map[args.run_mode], - use_static=False, - use_calib_mode=trt_calib_mode) + precision_mode=precision_map[args.run_mode]) use_dynamic_shape = True if mode == "det": diff --git a/deploy/python/preprocess.py b/deploy/python/preprocess.py index d447c744b75600886075c669e47d05036a93eae7..4fc80d1a33521f9b0b2a48c8e965fc3fb643110d 100644 --- a/deploy/python/preprocess.py +++ b/deploy/python/preprocess.py @@ -89,21 +89,15 @@ class Resize_Mult32(object): # limit the max side if self.limit_type == 'max': - if max(h, w) > limit_side_len: - if h > w: - ratio = float(limit_side_len) / h - else: - ratio = float(limit_side_len) / w + if h > w: + ratio = float(limit_side_len) / h else: - ratio = 1. + ratio = float(limit_side_len) / w elif self.limit_type == 'min': - if min(h, w) < limit_side_len: - if h < w: - ratio = float(limit_side_len) / h - else: - ratio = float(limit_side_len) / w + if h < w: + ratio = float(limit_side_len) / h else: - ratio = 1. + ratio = float(limit_side_len) / w elif self.limit_type == 'resize_long': ratio = float(limit_side_len) / max(h, w) else: