fix(TesserOcrModel): Fix cell coordinates

Signed-off-by: Nikos Livathinos <nli@zurich.ibm.com>
This commit is contained in:
Nikos Livathinos 2024-10-08 14:17:54 +02:00
parent 29e65e911b
commit 118afee1f3

View File

@ -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,
), ),
) )
) )