未验证 提交 22973cb9 编写于 作者: Z zhiboniu 提交者: GitHub

update vehicle plate trt params (#6658)

* fix trt params

* update config to make safe of trt input shape
上级 b98f0df3
......@@ -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]
......
......@@ -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
......
......@@ -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
......
......@@ -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":
......
......@@ -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 = []
......
......@@ -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":
......
......@@ -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
else:
ratio = 1.
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
else:
ratio = 1.
elif self.limit_type == 'resize_long':
ratio = float(limit_side_len) / max(h, w)
else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册