breezedeus/Pix2Text
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.
What it solves
Pix2Text (P2T) is an open-source Python alternative to Mathpix, designed to convert images and PDF files into structured Markdown format. It specifically addresses the difficulty of accurately recognizing and integrating complex content like mathematical formulas, tables, and varied page layouts into a single digital document.
How it works
P2T uses a pipeline of specialized AI models to process visual data:
- Layout Analysis: Identifies the structure of the page using models like DocLayout-YOLO.
- Formula Detection & Recognition: Uses dedicated MFD (Mathematical Formula Detection) and MFR (Mathematical Formula Recognition) models to identify and convert formulas into LaTeX/Markdown.
- Table Recognition: Converts visual tables into Markdown format.
- Text Recognition: Employs OCR engines (CnOCR for English/Chinese, EasyOCR for 80+ other languages) to extract plain text.
- VLM Integration: Supports closed-source Vision Language Models (VLMs) via the LiteLLM interface for table and formula OCR.
Who it’s for
- Researchers and students who need to digitize handwritten or printed mathematical notes and academic papers.
- Developers looking for a free, open-source OCR toolkit for complex document parsing.
- Users who want to convert scanned PDFs into editable Markdown files.
Highlights
- Comprehensive Parsing: Handles text, tables, and mathematical formulas in one workflow.
- Multilingual Support: Supports over 80 languages for text recognition.
- PDF to Markdown: Ability to convert entire PDF files, including scanned images, into Markdown.
- SOTA Formula Recognition: Utilizes high-accuracy MFR models trained on extensive datasets.
- Flexible Deployment: Available as a Python library, a command-line tool, an HTTP service, and a MacOS desktop application.
Related
- Project
- Project
- Project
- Project