From d8a20b16ad689737b1a5103da792a11b622b985b Mon Sep 17 00:00:00 2001 From: TongZ <471205975@qq.com> Date: Mon, 16 Dec 2024 08:14:37 +0800 Subject: [PATCH] fix: replace `rec_image_shape` when manually set (#14371) --- paddleocr.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paddleocr.py b/paddleocr.py index c814981fa..b479da768 100644 --- a/paddleocr.py +++ b/paddleocr.py @@ -664,6 +664,8 @@ class PaddleOCR(predict_system.TextSystem): params.rec_image_shape = "3, 48, 320" else: params.rec_image_shape = "3, 32, 320" + if kwargs.get("rec_image_shape") is not None: + params.rec_image_shape = kwargs.get("rec_image_shape") # download model if using paddle infer if not params.use_onnx: maybe_download(params.det_model_dir, det_url)