fix: replace `rec_image_shape` when manually set (#14371)

pull/14397/head
TongZ 2024-12-16 08:14:37 +08:00 committed by GitHub
parent ae67d96f3e
commit d8a20b16ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -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)