Skip to content

πŸ“„ Awesome OCR multiple programing languages toolkits based on ONNX Runtime, OpenVINO, MNN, PaddlePaddle, TensorRT and PyTorch.

Fix img_height bugs.

SWHL4d7a2e1a50d0
diff --git a/ocrweb/rapidocr_onnxruntime/ch_ppocr_v3_rec/text_recognize.py b/ocrweb/rapidocr_onnxruntime/ch_ppocr_v3_rec/text_recognize.py
index 70d99d7..753c811 100644
--- a/ocrweb/rapidocr_onnxruntime/ch_ppocr_v3_rec/text_recognize.py
+++ b/ocrweb/rapidocr_onnxruntime/ch_ppocr_v3_rec/text_recognize.py
@@ -45,7 +45,7 @@ class TextRecognizer(object):
img_channel, img_height, img_width = self.rec_image_shape
assert img_channel == img.shape[2]
- img_width = int((32 * max_wh_ratio))
+ img_width = int(img_height * max_wh_ratio)
h, w = img.shape[:2]
ratio = w / float(h)
diff --git a/python/rapidocr_onnxruntime/ch_ppocr_v3_rec/text_recognize.py b/python/rapidocr_onnxruntime/ch_ppocr_v3_rec/text_recognize.py
index a877401..f05fe30 100644
--- a/python/rapidocr_onnxruntime/ch_ppocr_v3_rec/text_recognize.py
+++ b/python/rapidocr_onnxruntime/ch_ppocr_v3_rec/text_recognize.py
@@ -85,7 +85,7 @@ class TextRecognizer(object):
img_channel, img_height, img_width = self.rec_image_shape
assert img_channel == img.shape[2]
- img_width = int((img_height * max_wh_ratio))
+ img_width = int(img_height * max_wh_ratio)
h, w = img.shape[:2]
ratio = w / float(h)
diff --git a/python/rapidocr_openvino/ch_ppocr_v3_rec/text_recognize.py b/python/rapidocr_openvino/ch_ppocr_v3_rec/text_recognize.py
index 12e4024..06c4831 100644
--- a/python/rapidocr_openvino/ch_ppocr_v3_rec/text_recognize.py
+++ b/python/rapidocr_openvino/ch_ppocr_v3_rec/text_recognize.py
@@ -85,7 +85,7 @@ class TextRecognizer(object):
img_channel, img_height, img_width = self.rec_image_shape
assert img_channel == img.shape[2]
- img_width = int((img_height * max_wh_ratio))
+ img_width = int(img_height * max_wh_ratio)
h, w = img.shape[:2]
ratio = w / float(h)