Skip to content

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

Add warning tip when skip the det.

SWHL585708efdd6f
diff --git a/python/rapidocr_onnxruntime/main.py b/python/rapidocr_onnxruntime/main.py
index e5b59eb..a047326 100644
--- a/python/rapidocr_onnxruntime/main.py
+++ b/python/rapidocr_onnxruntime/main.py
@@ -2,6 +2,7 @@
# @Author: SWHL
# @Contact: [email protected]
import copy
+import logging
from pathlib import Path
from typing import List, Optional, Tuple, Union
@@ -154,6 +155,9 @@ class RapidOCR:
use_limit_ratio = w / h > self.width_height_ratio
if h <= self.min_height or use_limit_ratio:
+ logging.warning(
+ f"Because the aspect ratio of the current image exceeds the limit (min_height or width_height_ratio), the program will skip the detection step."
+ )
dt_boxes, img_crop_list = self.get_boxes_img_without_det(img, h, w)
return dt_boxes, 0.0, img_crop_list
diff --git a/python/rapidocr_openvino/main.py b/python/rapidocr_openvino/main.py
index e5b59eb..a047326 100644
--- a/python/rapidocr_openvino/main.py
+++ b/python/rapidocr_openvino/main.py
@@ -2,6 +2,7 @@
# @Author: SWHL
# @Contact: [email protected]
import copy
+import logging
from pathlib import Path
from typing import List, Optional, Tuple, Union
@@ -154,6 +155,9 @@ class RapidOCR:
use_limit_ratio = w / h > self.width_height_ratio
if h <= self.min_height or use_limit_ratio:
+ logging.warning(
+ f"Because the aspect ratio of the current image exceeds the limit (min_height or width_height_ratio), the program will skip the detection step."
+ )
dt_boxes, img_crop_list = self.get_boxes_img_without_det(img, h, w)
return dt_boxes, 0.0, img_crop_list