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(table): improve table image processing
myhloli401dfa4e4f74
diff --git a/magic_pdf/model/ppTableModel.py b/magic_pdf/model/ppTableModel.pyindex 19669237..3f08d78d 100644--- a/magic_pdf/model/ppTableModel.py+++ b/magic_pdf/model/ppTableModel.py@@ -1,3 +1,4 @@+import cv2from paddleocr.ppstructure.table.predict_table import TableSystemfrom paddleocr.ppstructure.utility import init_argsfrom magic_pdf.libs.Constants import *@@ -36,7 +37,8 @@ class ppTableModel(object):- HTML (str): A string representing the HTML structure with content of the table."""if isinstance(image, Image.Image):- image = np.array(image)+ image = np.asarray(image)+ image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)pred_res, _ = self.table_sys(image)pred_html = pred_res["html"]# res = '<td><table border="1">' + pred_html.replace("<html><body><table>", "").replace(