An Open-Source Python3 tool with SMALL models for recognizing layouts, tables, math formulas (LaTeX), and text in images, converting them into Markdown format. A free alternative to Mathpix, empowering seamless conversion of visual content into text-based representations. 80+ languages are supported.
from pix2text import Pix2Text uer_temp_dir = get_user_temp_dir(user_id=user_id,doc_id=doc_id) p2t = Pix2Text.from_config(device="cpu",enable_formula=False) doc = p2t.recognize_pdf(file_path) doc.to_markdown(uer_temp_dir)
报错:
latex_ocr
model MUST NOT be None