Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.
Python ai4sciencedocument-analysisdocxextract-datalayout-analysisocrparserpdfpdf-converterpdf-extractor-llmpdf-extractor-pretrainpdf-extractor-ragpdf-parserpptxpythonxlsx
fix: update predict method to handle optional OCR results and improve image processing flow
myhloli62fb477beb14
diff --git a/mineru/model/table/rec/slanet_plus/main.py b/mineru/model/table/rec/slanet_plus/main.pyindex 5b6d2bc6..103e576e 100644--- a/mineru/model/table/rec/slanet_plus/main.py+++ b/mineru/model/table/rec/slanet_plus/main.py@@ -158,18 +158,17 @@ class RapidTableModel(object):self.table_model = RapidTable(input_args)self.ocr_engine = ocr_engine- def predict(self, image, table_cls_score):+ def predict(self, image, ocr_result=None):bgr_image = cv2.cvtColor(np.asarray(image), cv2.COLOR_RGB2BGR)# Continue with OCR on potentially rotated image- ocr_result = self.ocr_engine.ocr(bgr_image)[0]- if ocr_result:++ if not ocr_result:+ ocr_result = self.ocr_engine.ocr(bgr_image)[0]ocr_result = [[item[0], escape_html(item[1][0]), item[1][1]]for item in ocr_resultif len(item) == 2 and isinstance(item[1], tuple)]- else:- ocr_result = Noneif ocr_result:try: