From de0da9ef8fb35bb02e8fe97745f40da1fa013a92 Mon Sep 17 00:00:00 2001 From: yunyaoXYY <109218879+yunyaoXYY@users.noreply.github.com> Date: Fri, 2 Dec 2022 11:19:00 +0800 Subject: [PATCH] [Bug Fix] Modify TRT dynamic input shape for PP-OCRv2 python demo. (#775) * Imporve OCR Readme * Improve OCR Readme * Improve OCR Readme * Improve OCR Readme * Improve OCR Readme * Add Initialize function to PP-OCR * Add Initialize function to PP-OCR * Add Initialize function to PP-OCR * Make all the model links come from PaddleOCR * Improve OCR readme * Improve OCR readme * Improve OCR readme * Improve OCR readme * Add Readme for vision results * Add Readme for vision results * Add Readme for vision results * Add Readme for vision results * Add Readme for vision results * Add Readme for vision results * Add Readme for vision results * Add Readme for vision results * Add Readme for vision results * Add Readme for vision results * Add check for label file in postprocess of Rec model * Add check for label file in postprocess of Rec model * Add check for label file in postprocess of Rec model * Add check for label file in postprocess of Rec model * Add check for label file in postprocess of Rec model * Add check for label file in postprocess of Rec model * Add comments to create API docs * Improve OCR comments * Rename OCR and add comments * Make sure previous python example works * Make sure previous python example works * Fix Rec model bug * Fix Rec model bug * Fix rec model bug * Add SetTrtMaxBatchSize function for TensorRT * Add SetTrtMaxBatchSize Pybind * Add set_trt_max_batch_size python function * Set TRT dynamic shape in PPOCR examples * Set TRT dynamic shape in PPOCR examples * Set TRT dynamic shape in PPOCR examples * Fix PPOCRv2 python example * Fix PPOCR dynamic input shape bug * Remove useless code * Fix PPOCR bug * Remove useless comments in PaddleSeg example * Fix quantize docs readme * Fix PP-OCRv2 readme * Modify dynamic shape in PP-OCRv2 example * Modify TRT dynamic shape for PP-OCRv2 Co-authored-by: Jason --- examples/vision/ocr/PP-OCRv2/python/infer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/vision/ocr/PP-OCRv2/python/infer.py b/examples/vision/ocr/PP-OCRv2/python/infer.py index 0dce3f95c..af915143a 100644 --- a/examples/vision/ocr/PP-OCRv2/python/infer.py +++ b/examples/vision/ocr/PP-OCRv2/python/infer.py @@ -119,7 +119,7 @@ det_model = fd.vision.ocr.DBDetector( cls_option = runtime_option cls_option.set_trt_input_shape("x", [1, 3, 48, 10], [10, 3, 48, 320], - [64, 3, 48, 1024]) + [32, 3, 48, 1024]) # 用户可以把TRT引擎文件保存至本地 # cls_option.set_trt_cache_file(args.cls_model + "/cls_trt_cache.trt") cls_model = fd.vision.ocr.Classifier( @@ -127,7 +127,7 @@ cls_model = fd.vision.ocr.Classifier( rec_option = runtime_option rec_option.set_trt_input_shape("x", [1, 3, 32, 10], [10, 3, 32, 320], - [64, 3, 32, 2304]) + [32, 3, 32, 2304]) # 用户可以把TRT引擎文件保存至本地 # rec_option.set_trt_cache_file(args.rec_model + "/rec_trt_cache.trt") rec_model = fd.vision.ocr.Recognizer(