ocr-stream 2.2__tar.gz → 2.2.6__tar.gz
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.
- {ocr_stream-2.2 → ocr_stream-2.2.6}/PKG-INFO +1 -1
- {ocr_stream-2.2 → ocr_stream-2.2.6}/ocr_stream/recognize.py +9 -5
- {ocr_stream-2.2 → ocr_stream-2.2.6}/ocr_stream.egg-info/PKG-INFO +1 -1
- {ocr_stream-2.2 → ocr_stream-2.2.6}/pyproject.toml +1 -1
- {ocr_stream-2.2 → ocr_stream-2.2.6}/README.md +0 -0
- {ocr_stream-2.2 → ocr_stream-2.2.6}/ocr_stream/__init__.py +0 -0
- {ocr_stream-2.2 → ocr_stream-2.2.6}/ocr_stream/bin_tess/__init__.py +0 -0
- {ocr_stream-2.2 → ocr_stream-2.2.6}/ocr_stream/modules/__init__.py +0 -0
- {ocr_stream-2.2 → ocr_stream-2.2.6}/ocr_stream/ocr/__init__.py +0 -0
- {ocr_stream-2.2 → ocr_stream-2.2.6}/ocr_stream.egg-info/SOURCES.txt +0 -0
- {ocr_stream-2.2 → ocr_stream-2.2.6}/ocr_stream.egg-info/dependency_links.txt +0 -0
- {ocr_stream-2.2 → ocr_stream-2.2.6}/ocr_stream.egg-info/requires.txt +0 -0
- {ocr_stream-2.2 → ocr_stream-2.2.6}/ocr_stream.egg-info/top_level.txt +0 -0
- {ocr_stream-2.2 → ocr_stream-2.2.6}/setup.cfg +0 -0
|
@@ -84,7 +84,8 @@ class RecognizePdf(object):
|
|
|
84
84
|
return text_recognized.to_document()
|
|
85
85
|
|
|
86
86
|
def recognize_document(self, doc: DocumentPdf) -> DocumentPdf:
|
|
87
|
-
|
|
87
|
+
_pages: list[PageDocumentPdf] = []
|
|
88
|
+
_pages.clear()
|
|
88
89
|
_conv = ConvertPdfToImages.create(doc)
|
|
89
90
|
images: list[ImageObject] = _conv.to_images()
|
|
90
91
|
max_num: int = len(images)
|
|
@@ -94,12 +95,15 @@ class RecognizePdf(object):
|
|
|
94
95
|
f'Aplicando OCR [{num+1} de {max_num}]'
|
|
95
96
|
)
|
|
96
97
|
text_recognized = self.recognize_image.image_recognize(img)
|
|
97
|
-
|
|
98
|
+
_pages.append(text_recognized.to_page_pdf())
|
|
98
99
|
print()
|
|
99
100
|
self.pbar.stop()
|
|
100
|
-
|
|
101
|
+
new_doc = DocumentPdf.create_from_pages(_pages)
|
|
102
|
+
return new_doc
|
|
101
103
|
|
|
102
104
|
def recognize_file_pdf(self, file: File) -> DocumentPdf:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
file_doc = DocumentPdf.create_from_file(file)
|
|
106
|
+
recognized_doc = self.recognize_document(file_doc)
|
|
107
|
+
del file_doc
|
|
108
|
+
return recognized_doc
|
|
105
109
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|