Skip to content

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

Remove the invalid max_wh_ratio

SWHLb043069f54a0
diff --git a/ocrweb/rapidocr_onnxruntime/ch_ppocr_v2_cls/text_cls.py b/ocrweb/rapidocr_onnxruntime/ch_ppocr_v2_cls/text_cls.py
index 38d8549..89b46f2 100644
--- a/ocrweb/rapidocr_onnxruntime/ch_ppocr_v2_cls/text_cls.py
+++ b/ocrweb/rapidocr_onnxruntime/ch_ppocr_v2_cls/text_cls.py
@@ -79,11 +79,6 @@ class TextClassifier(object):
elapse = 0
for beg_img_no in range(0, img_num, batch_num):
end_img_no = min(img_num, beg_img_no + batch_num)
- max_wh_ratio = 0
- for ino in range(beg_img_no, end_img_no):
- h, w = img_list[indices[ino]].shape[0:2]
- wh_ratio = w * 1.0 / h
- max_wh_ratio = max(max_wh_ratio, wh_ratio)
norm_img_batch = []
for ino in range(beg_img_no, end_img_no):
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 4887188..70d99d7 100644
--- a/ocrweb/rapidocr_onnxruntime/ch_ppocr_v3_rec/text_recognize.py
+++ b/ocrweb/rapidocr_onnxruntime/ch_ppocr_v3_rec/text_recognize.py
@@ -46,7 +46,6 @@ class TextRecognizer(object):
assert img_channel == img.shape[2]
img_width = int((32 * max_wh_ratio))
- max_wh_ratio = 1
h, w = img.shape[:2]
ratio = w / float(h)
diff --git a/python/rapidocr_onnxruntime/ch_ppocr_v2_cls/text_cls.py b/python/rapidocr_onnxruntime/ch_ppocr_v2_cls/text_cls.py
index bdd6e17..6ea2e4b 100644
--- a/python/rapidocr_onnxruntime/ch_ppocr_v2_cls/text_cls.py
+++ b/python/rapidocr_onnxruntime/ch_ppocr_v2_cls/text_cls.py
@@ -55,11 +55,6 @@ class TextClassifier(object):
elapse = 0
for beg_img_no in range(0, img_num, batch_num):
end_img_no = min(img_num, beg_img_no + batch_num)
- max_wh_ratio = 0
- for ino in range(beg_img_no, end_img_no):
- h, w = img_list[indices[ino]].shape[0:2]
- wh_ratio = w * 1.0 / h
- max_wh_ratio = max(max_wh_ratio, wh_ratio)
norm_img_batch = []
for ino in range(beg_img_no, end_img_no):
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 b7a1b50..a877401 100644
--- a/python/rapidocr_onnxruntime/ch_ppocr_v3_rec/text_recognize.py
+++ b/python/rapidocr_onnxruntime/ch_ppocr_v3_rec/text_recognize.py
@@ -86,7 +86,6 @@ class TextRecognizer(object):
assert img_channel == img.shape[2]
img_width = int((img_height * max_wh_ratio))
- max_wh_ratio = 1
h, w = img.shape[:2]
ratio = w / float(h)
diff --git a/python/rapidocr_openvino/ch_ppocr_v2_cls/text_cls.py b/python/rapidocr_openvino/ch_ppocr_v2_cls/text_cls.py
index fc7bd35..1c5bf19 100644
--- a/python/rapidocr_openvino/ch_ppocr_v2_cls/text_cls.py
+++ b/python/rapidocr_openvino/ch_ppocr_v2_cls/text_cls.py
@@ -54,11 +54,6 @@ class TextClassifier(object):
elapse = 0
for beg_img_no in range(0, img_num, batch_num):
end_img_no = min(img_num, beg_img_no + batch_num)
- max_wh_ratio = 0
- for ino in range(beg_img_no, end_img_no):
- h, w = img_list[indices[ino]].shape[0:2]
- wh_ratio = w * 1.0 / h
- max_wh_ratio = max(max_wh_ratio, wh_ratio)
norm_img_batch = []
for ino in range(beg_img_no, end_img_no):
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 c3b7e96..12e4024 100644
--- a/python/rapidocr_openvino/ch_ppocr_v3_rec/text_recognize.py
+++ b/python/rapidocr_openvino/ch_ppocr_v3_rec/text_recognize.py
@@ -86,7 +86,6 @@ class TextRecognizer(object):
assert img_channel == img.shape[2]
img_width = int((img_height * max_wh_ratio))
- max_wh_ratio = 1
h, w = img.shape[:2]
ratio = w / float(h)