feat(ocr): Add OnnxTR as possible OCR engine

Signed-off-by: felix <felixdittrich92@gmail.com>
This commit is contained in:
felix 2025-03-31 14:31:47 +02:00
parent 4cd2ec5515
commit 1f9872c8ae
2 changed files with 8065 additions and 2 deletions

8061
poetry.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -76,8 +76,8 @@ onnxtr = { extras = ["gpu"], version = "^0.6.2", optional = true, markers = "pyt
onnxruntime = [ onnxruntime = [
# 1.19.2 is the last version with python3.9 support, # 1.19.2 is the last version with python3.9 support,
# see https://github.com/microsoft/onnxruntime/releases/tag/v1.20.0 # see https://github.com/microsoft/onnxruntime/releases/tag/v1.20.0
{ version = "^1.7.0", optional = true, markers = "python_version < '3.10'" }, { version = ">=1.7.0,<1.20.0", optional = true, markers = "python_version < '3.10'" },
{ version = ">=1.7.0,<2.0.0", optional = true, markers = "python_version >= '3.10'" }, { version = "^1.7.0", optional = true, markers = "python_version >= '3.10'" },
] ]
transformers = [ transformers = [
@ -149,6 +149,7 @@ torchvision = [
] ]
[tool.poetry.extras] [tool.poetry.extras]
onnxtr = ["onnxtr"]
tesserocr = ["tesserocr"] tesserocr = ["tesserocr"]
ocrmac = ["ocrmac"] ocrmac = ["ocrmac"]
vlm = ["transformers", "accelerate"] vlm = ["transformers", "accelerate"]
@ -193,6 +194,7 @@ module = [
"docling_ibm_models.*", "docling_ibm_models.*",
"easyocr.*", "easyocr.*",
"ocrmac.*", "ocrmac.*",
"onnxtr.*",
"mlx_vlm.*", "mlx_vlm.*",
"lxml.*", "lxml.*",
"huggingface_hub.*", "huggingface_hub.*",