sbt-idp/cope2n-ai-fi/modules/ocr_engine/__init__.py

20 lines
692 B
Python
Raw Normal View History

2023-11-30 11:22:16 +00:00
# # Define package-level variables
# __version__ = '0.0'
import os
import sys
from pathlib import Path
cur_dir = str(Path(__file__).parents[0])
sys.path.append(cur_dir)
sys.path.append(os.path.join(cur_dir, "externals"))
# Import modules
from .run import load_engine
from .src.ocr import OcrEngine
# from .src.word_formation import words_to_lines
from .src.word_formation import words_to_lines_tesseract as words_to_lines
from .src.utils import ImageReader, read_ocr_result_from_txt
from .src.dto import Word, Line, Page, Document, Box
# Expose package contents
__all__ = ["OcrEngine", "Box", "Word", "Line", "Page", "Document", "words_to_lines", "ImageReader", "read_ocr_result_from_txt"]