mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-27 04:24:45 +00:00
fix(TesserOcrModel): Fix cell coordinates
Signed-off-by: Nikos Livathinos <nli@zurich.ibm.com>
This commit is contained in:
parent
29e65e911b
commit
118afee1f3
@ -47,7 +47,6 @@ class TesserOcrModel(BaseOcrModel):
|
|||||||
def __del__(self):
|
def __del__(self):
|
||||||
if self.reader is not None:
|
if self.reader is not None:
|
||||||
# Finalize the tesseractAPI
|
# Finalize the tesseractAPI
|
||||||
_log.debug("Finalize TesserOCR")
|
|
||||||
self.reader.End()
|
self.reader.End()
|
||||||
|
|
||||||
def __call__(self, page_batch: Iterable[Page]) -> Iterable[Page]:
|
def __call__(self, page_batch: Iterable[Page]) -> Iterable[Page]:
|
||||||
@ -91,9 +90,8 @@ class TesserOcrModel(BaseOcrModel):
|
|||||||
text=text,
|
text=text,
|
||||||
confidence=confidence,
|
confidence=confidence,
|
||||||
bbox=BoundingBox.from_tuple(
|
bbox=BoundingBox.from_tuple(
|
||||||
# l, b, r, t = coord[0], coord[1], coord[2], coord[3]
|
coord=(left, top, right, bottom),
|
||||||
coord=(left, bottom, right, top),
|
origin=CoordOrigin.TOPLEFT,
|
||||||
origin=CoordOrigin.BOTTOMLEFT,
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user