From c0f170bb727c6e3a6abfcc823fbdc5355f490c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Doumouro?= Date: Tue, 8 Apr 2025 15:08:24 +0200 Subject: [PATCH] fix(ocr): move bounding bow rotation util to orientation.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Clément Doumouro --- docling/models/tesseract_ocr_cli_model.py | 1 + docling/utils/ocr_utils.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docling/models/tesseract_ocr_cli_model.py b/docling/models/tesseract_ocr_cli_model.py index 0f9ce201..ab644f3b 100644 --- a/docling/models/tesseract_ocr_cli_model.py +++ b/docling/models/tesseract_ocr_cli_model.py @@ -27,6 +27,7 @@ from docling.utils.ocr_utils import ( parse_tesseract_orientation, tesseract_box_to_bounding_rectangle, ) +from docling.utils.orientation import Box from docling.utils.profiling import TimeRecorder _log = logging.getLogger(__name__) diff --git a/docling/utils/ocr_utils.py b/docling/utils/ocr_utils.py index c4bc9695..a3e3092e 100644 --- a/docling/utils/ocr_utils.py +++ b/docling/utils/ocr_utils.py @@ -1,9 +1,12 @@ -from typing import Optional, Tuple +from typing import Optional from docling_core.types.doc import BoundingBox, CoordOrigin from docling_core.types.doc.page import BoundingRectangle -from docling.utils.orientation import CLIPPED_ORIENTATIONS, rotate_bounding_box +from docling.utils.orientation import ( + CLIPPED_ORIENTATIONS, + rotate_bounding_box, +) def map_tesseract_script(script: str) -> str: