natural-pdf 0.1.26.dev0__py3-none-any.whl → 0.1.28__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- natural_pdf/analyzers/layout/layout_manager.py +1 -1
- natural_pdf/analyzers/layout/yolo.py +2 -2
- natural_pdf/ocr/engine_paddle.py +1 -1
- natural_pdf/ocr/ocr_factory.py +8 -8
- natural_pdf/ocr/ocr_manager.py +1 -1
- {natural_pdf-0.1.26.dev0.dist-info → natural_pdf-0.1.28.dist-info}/METADATA +1 -1
- {natural_pdf-0.1.26.dev0.dist-info → natural_pdf-0.1.28.dist-info}/RECORD +11 -11
- {natural_pdf-0.1.26.dev0.dist-info → natural_pdf-0.1.28.dist-info}/WHEEL +0 -0
- {natural_pdf-0.1.26.dev0.dist-info → natural_pdf-0.1.28.dist-info}/entry_points.txt +0 -0
- {natural_pdf-0.1.26.dev0.dist-info → natural_pdf-0.1.28.dist-info}/licenses/LICENSE +0 -0
- {natural_pdf-0.1.26.dev0.dist-info → natural_pdf-0.1.28.dist-info}/top_level.txt +0 -0
@@ -131,7 +131,7 @@ class LayoutManager:
|
|
131
131
|
# Construct helpful error message with install hint
|
132
132
|
install_hint = ""
|
133
133
|
if engine_name in {"yolo", "paddle", "surya", "docling"}:
|
134
|
-
install_hint = f"
|
134
|
+
install_hint = f"npdf install {engine_name}"
|
135
135
|
elif engine_name == "tatr":
|
136
136
|
install_hint = "(should be installed with natural-pdf core dependencies)"
|
137
137
|
elif engine_name == "gemini":
|
@@ -92,7 +92,7 @@ class YOLODocLayoutDetector(LayoutDetector):
|
|
92
92
|
"""Load the YOLOv10 model based on options."""
|
93
93
|
if not self.is_available():
|
94
94
|
raise RuntimeError(
|
95
|
-
"YOLO dependencies not installed. Please run:
|
95
|
+
"YOLO dependencies not installed. Please run: npdf install yolo"
|
96
96
|
)
|
97
97
|
self.logger.info(f"Loading YOLO model: {options.model_repo}/{options.model_file}")
|
98
98
|
try:
|
@@ -108,7 +108,7 @@ class YOLODocLayoutDetector(LayoutDetector):
|
|
108
108
|
"""Detect layout elements in an image using YOLO."""
|
109
109
|
if not self.is_available():
|
110
110
|
raise RuntimeError(
|
111
|
-
"YOLO dependencies not installed. Please run:
|
111
|
+
"YOLO dependencies not installed. Please run: npdf install yolo"
|
112
112
|
)
|
113
113
|
|
114
114
|
# Ensure options are the correct type, falling back to defaults if base type passed
|
natural_pdf/ocr/engine_paddle.py
CHANGED
@@ -127,7 +127,7 @@ class PaddleOCREngine(OCREngine):
|
|
127
127
|
except ImportError as e:
|
128
128
|
self.logger.error(f"Failed to import PaddleOCR/PaddlePaddle: {e}")
|
129
129
|
raise RuntimeError(
|
130
|
-
"paddleocr is not available. Install via:
|
130
|
+
"paddleocr is not available. Install via: npdf install paddle"
|
131
131
|
) from e
|
132
132
|
|
133
133
|
paddle_options = options if isinstance(options, PaddleOCROptions) else PaddleOCROptions()
|
natural_pdf/ocr/ocr_factory.py
CHANGED
@@ -32,7 +32,7 @@ class OCRFactory:
|
|
32
32
|
return SuryaOCREngine(**kwargs)
|
33
33
|
except ImportError:
|
34
34
|
raise ImportError(
|
35
|
-
"Surya engine requires additional dependencies. " "Install with:
|
35
|
+
"Surya engine requires additional dependencies. " "Install with: npdf install surya"
|
36
36
|
)
|
37
37
|
elif engine_type == "easyocr":
|
38
38
|
try:
|
@@ -42,7 +42,7 @@ class OCRFactory:
|
|
42
42
|
except ImportError:
|
43
43
|
raise ImportError(
|
44
44
|
"EasyOCR engine requires the 'easyocr' package. "
|
45
|
-
"Install with: pip install easyocr (or
|
45
|
+
"Install with: pip install easyocr (or npdf install easyocr when available)"
|
46
46
|
)
|
47
47
|
elif engine_type == "paddle":
|
48
48
|
try:
|
@@ -52,7 +52,7 @@ class OCRFactory:
|
|
52
52
|
except ImportError:
|
53
53
|
raise ImportError(
|
54
54
|
"PaddleOCR engine requires 'paddleocr' and 'paddlepaddle'. "
|
55
|
-
"Install with:
|
55
|
+
"Install with: npdf install paddle"
|
56
56
|
)
|
57
57
|
elif engine_type == "doctr":
|
58
58
|
try:
|
@@ -137,9 +137,9 @@ class OCRFactory:
|
|
137
137
|
|
138
138
|
# If we get here, no engines are available
|
139
139
|
raise ImportError(
|
140
|
-
"No OCR engines are installed. You can add one via the
|
141
|
-
"
|
142
|
-
"
|
143
|
-
"
|
144
|
-
"
|
140
|
+
"No OCR engines are installed. You can add one via the npdf installer, e.g.:\n"
|
141
|
+
" npdf install easyocr # fastest to set up\n"
|
142
|
+
" npdf install paddle # best Asian-language accuracy\n"
|
143
|
+
" npdf install surya # Surya OCR engine\n"
|
144
|
+
" npdf install yolo # Layout detection (YOLO)\n"
|
145
145
|
)
|
natural_pdf/ocr/ocr_manager.py
CHANGED
@@ -94,7 +94,7 @@ class OCRManager:
|
|
94
94
|
engine_instance = engine_class() # Instantiate first
|
95
95
|
if not engine_instance.is_available():
|
96
96
|
# Check availability before storing
|
97
|
-
install_hint = f"
|
97
|
+
install_hint = f"npdf install {engine_name}"
|
98
98
|
|
99
99
|
raise RuntimeError(
|
100
100
|
f"Engine '{engine_name}' is not available. Please install the required dependencies: {install_hint}"
|
@@ -10,14 +10,14 @@ natural_pdf/analyzers/layout/base.py,sha256=bYawhmc_0xqKG-xbxUSiazIU1om-aBox5Jh8
|
|
10
10
|
natural_pdf/analyzers/layout/docling.py,sha256=4BJYyNVR6VegZGxyisvNIBBRvVk6YKPyDVs7ZdVfzEU,12676
|
11
11
|
natural_pdf/analyzers/layout/gemini.py,sha256=ldECVCQ5HNQA3Omjg2NOsTrJXslyYb0vErDncmLIiuE,10510
|
12
12
|
natural_pdf/analyzers/layout/layout_analyzer.py,sha256=n327Zjuf7aSzKQKChPHeiCVHinzeDGaWNyKiwQ-DkJk,15571
|
13
|
-
natural_pdf/analyzers/layout/layout_manager.py,sha256=
|
13
|
+
natural_pdf/analyzers/layout/layout_manager.py,sha256=i887PY1vdlx7Hnkyf7JSAPAbnozT9hGK_RmYAoCRpyA,8576
|
14
14
|
natural_pdf/analyzers/layout/layout_options.py,sha256=-Nv6bcu4_pqSCN6uNhCZ9mvoCBtRDZIUkO6kjkuLXsg,7703
|
15
15
|
natural_pdf/analyzers/layout/paddle.py,sha256=tX2bI1yayAdmRhvsfZ_Ygs7zAG5e9eW-pLJkw4NUpBQ,21325
|
16
16
|
natural_pdf/analyzers/layout/pdfplumber_table_finder.py,sha256=Tk0Q7wv7nGYPo69lh6RoezjdepTnMl90SaNIrP29Pwc,5902
|
17
17
|
natural_pdf/analyzers/layout/surya.py,sha256=4RdnhRxSS3i3Ns5mFhOA9-P0xd7Ms19uZuKvUGQfEBI,9789
|
18
18
|
natural_pdf/analyzers/layout/table_structure_utils.py,sha256=nISZDBd46RPYkFHxbQyIHwg9WweG4DslpoYJ31OMJYA,2768
|
19
19
|
natural_pdf/analyzers/layout/tatr.py,sha256=cVr0ZyhY2mNLAKZ4DGMm-b7XNJpILKh8x8ZpyDeUhLk,15032
|
20
|
-
natural_pdf/analyzers/layout/yolo.py,sha256=
|
20
|
+
natural_pdf/analyzers/layout/yolo.py,sha256=ruchj28sxar0DWDALwUz1j30z0CLIEp2QAs0gLVvC4E,8346
|
21
21
|
natural_pdf/classification/manager.py,sha256=7HOyHdjMJtC9DfzI8OXAREnGDpXaAgSfTFVC42n3tVQ,18889
|
22
22
|
natural_pdf/classification/mixin.py,sha256=nYpmHQ4BlrealdPtIJt-_idME5o-xKLKNuAdIHzWL6c,7580
|
23
23
|
natural_pdf/classification/results.py,sha256=Mcay-xLBHbYoZ8U7f4gMj2IhhH_yORNEkZHWdWJzmsU,3239
|
@@ -63,10 +63,10 @@ natural_pdf/ocr/__init__.py,sha256=VY8hhvDPf7Gh2lB-d2QRmghLLyTy6ydxlgo1cS4dOSk,2
|
|
63
63
|
natural_pdf/ocr/engine.py,sha256=ZBC1tZNM5EDbGDJJmZI9mNHr4nCMLEZvUFhiJq8GdF4,8741
|
64
64
|
natural_pdf/ocr/engine_doctr.py,sha256=ptKrupMWoulZb-R93zr9btoe94JPWU7vlJuN7OBJEIM,17740
|
65
65
|
natural_pdf/ocr/engine_easyocr.py,sha256=bWz6kHUgAJfe3rqdnZBAF-IPvw3B35DlvX5KDdFUtzo,9888
|
66
|
-
natural_pdf/ocr/engine_paddle.py,sha256=
|
66
|
+
natural_pdf/ocr/engine_paddle.py,sha256=9tQZl1VqN6d_KEWUY_S9tfrDLiR4FCHMjgSRNwPlsu8,16152
|
67
67
|
natural_pdf/ocr/engine_surya.py,sha256=lOvSbZk53VKFVxRmqcQzM_0dHVdwTkRGiDZ9AWCgL1Q,5951
|
68
|
-
natural_pdf/ocr/ocr_factory.py,sha256=
|
69
|
-
natural_pdf/ocr/ocr_manager.py,sha256=
|
68
|
+
natural_pdf/ocr/ocr_factory.py,sha256=qjGL3hm_nTzxjwYWP0JE7dCFXZjKN8Z7f9c0oqasb9M,5262
|
69
|
+
natural_pdf/ocr/ocr_manager.py,sha256=bLR2IowLKWaSrgR86SfOEbmcbn-DZUEXK9-fl5PiNM8,14256
|
70
70
|
natural_pdf/ocr/ocr_options.py,sha256=l33QKu_93r-uwi3t_v8UH8pEgHo6HTVzP4tfmQFRF1w,5488
|
71
71
|
natural_pdf/ocr/utils.py,sha256=OxuHwDbHWj6setvnC0QYwMHrAjxGkhmLzWHpMqqGupA,4397
|
72
72
|
natural_pdf/qa/__init__.py,sha256=2u2KJcA71g1I0HnLD-j6yvDw1moAjo9kkLhhfoYRURM,166
|
@@ -92,9 +92,9 @@ natural_pdf/utils/text_extraction.py,sha256=mDeN1_VevNi3RwvFe48PM5vBh-A5WeBlYgP6
|
|
92
92
|
natural_pdf/utils/visualization.py,sha256=30pRWQdsRJh2pSObh-brKVsFgC1n8tHmSrta_UDnVPw,8989
|
93
93
|
natural_pdf/widgets/__init__.py,sha256=QTVaUmsw__FCweFYZebwPssQxxUFUMd0wpm_cUbGZJY,181
|
94
94
|
natural_pdf/widgets/viewer.py,sha256=2VUY1TzWMDe9I-IVNOosKZ2LaqpjLB62ftMAdk-s6_8,24952
|
95
|
-
natural_pdf-0.1.
|
96
|
-
natural_pdf-0.1.
|
97
|
-
natural_pdf-0.1.
|
98
|
-
natural_pdf-0.1.
|
99
|
-
natural_pdf-0.1.
|
100
|
-
natural_pdf-0.1.
|
95
|
+
natural_pdf-0.1.28.dist-info/licenses/LICENSE,sha256=9zfwINwJlarbDmdh6iJV4QUG54QSJlSAUcnC1YiC_Ns,1074
|
96
|
+
natural_pdf-0.1.28.dist-info/METADATA,sha256=7zn_ijkJlLhA7CwrsRBT2FememV4ZLxne-FbNDBzV84,6684
|
97
|
+
natural_pdf-0.1.28.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
98
|
+
natural_pdf-0.1.28.dist-info/entry_points.txt,sha256=1R_KMv7g60UBBpRqGfw7bppsMNGdayR-iJlb9ohEk_8,81
|
99
|
+
natural_pdf-0.1.28.dist-info/top_level.txt,sha256=Cyw1zmNDlUZfb5moU-WUWGprrwH7ln_8LDGdmMHF1xI,17
|
100
|
+
natural_pdf-0.1.28.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|