Skip to content

Commit

Permalink
Add warning tip when skip the det.
Browse files Browse the repository at this point in the history
  • Loading branch information
SWHL committed Oct 8, 2023
1 parent 37e49c6 commit 585708e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/rapidocr_onnxruntime/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# @Author: SWHL
# @Contact: [email protected]
import copy
import logging
from pathlib import Path
from typing import List, Optional, Tuple, Union

Expand Down Expand Up @@ -154,6 +155,9 @@ def auto_text_det(
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

Expand Down
4 changes: 4 additions & 0 deletions python/rapidocr_openvino/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# @Author: SWHL
# @Contact: [email protected]
import copy
import logging
from pathlib import Path
from typing import List, Optional, Tuple, Union

Expand Down Expand Up @@ -154,6 +155,9 @@ def auto_text_det(
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

Expand Down

0 comments on commit 585708e

Please sign in to comment.