Pix2Text

breezedeusMIT活跃维护

用小型模型把图片里的版面、表格、数学公式和文字识别成 Markdown,支持 80 多种语言,是 Mathpix 的免费替代方案。

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.

v1.1.7发布于 2026-08-23 09:24 UTC3,284star +2 / 7 天283fork同步于 2026-11-10 11:41 UTC

怎么上手

由 README 提炼,执行前请确认
pip install pix2text
pip install pix2text[multilingual]
硬件要求按 README 说明

README 未说明显存、GPU 型号或 CPU 运行要求

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

开源 Python 工具,用小模型把图片和 PDF 里的版面、表格、公式和文字识别成 Markdown,是 Mathpix 的免费替代

用小型模型把图片里的版面、表格、数学公式和文字识别成 Markdown,支持 80 多种语言,是 Mathpix 的免费替代方案。

核心能力

  • 集成版面分析、表格识别、公式检测与识别、文字识别多个小模型
  • 把版面、表格、图片、文字和公式整合输出为 Markdown 格式
  • 支持整份 PDF(含扫描件)直接转换为 Markdown
  • 文字识别覆盖英语、简繁体中文、越南语等 80 多种语言
  • 可选 VLM 接口调用闭源视觉大模型做表格和文字公式识别

容易踩的坑

识别英语和简体中文以外的语言需额外安装 pix2text[multilingual];首次运行需从 HuggingFace 下载版面、表格、MFD、MFR 等模型,国内可改用 hf-mirror 镜像;使用 VLM 模型需单独安装 pix2text[vlm] 并配置 LiteLLM 接口

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.1.7
  1. v1.1.7fix: release v1.1.7 with MiniMax VLM endpoint support最新正式版2026-08-23 · 2026-08-23 09:24 UTC

    Update 2026.08.23: V1.1.7 Released

    Major Changes:

    • Added api_base configuration for OpenAI-compatible VLM endpoints, including MiniMax-M3.
    • Forward VLM call options through the public text and formula recognition APIs.

    主要变更:

    • 支持为 OpenAI 兼容的 VLM 接口配置 api_base,包括 MiniMax-M3。
    • 公开的文本和公式识别接口会继续传递 VLM 调用参数。
  2. v1.1.6feat: enhance Pix2Text initialization with total_configs support 2026-02-07 · 2026-02-07 11:13 UTC
    查看更新说明

    Update 2026.02.07: V1.1.6 Released

    Major Changes:

    • The Pix2Text class now supports config-based initialization directly via __init__, with the same parameters as from_config(). Users can now use Pix2Text(total_configs=..., enable_table=True, device='cuda') instead of Pix2Text.from_config(...).

    主要变更:

    • Pix2Text 类现在支持通过 __init__ 直接进行基于配置的初始化,参数与 from_config() 相同。用户现在可以使用 Pix2Text(total_configs=..., enable_table=True, device='cuda') 代替 Pix2Text.from_config(...)。
  3. v1.1.5refactor model downloading in utils.py to use HuggingFaceDownloader2026-02-07 · 2026-02-07 10:45 UTC
    查看更新说明

    Update 2026.02.07: V1.1.5 Released

    Major Changes:

    • Refactored model download to use huggingface_hub.snapshot_download() with a mirror fallback list (official endpoint first).

    主要变更:

    • 模型下载逻辑改用 huggingface_hub.snapshot_download(),并支持镜像列表按顺序回退(优先官方地址)。
  4. v1.1.4feat: add new models MFD-1.5 & MFR-1.52025-07-24 · 2025-07-24 16:02 UTC
    查看更新说明

    Update 2025.07.25: V1.1.4 Released

    Major Changes:

    • Upgraded the Mathematical Formula Detection (MFD) and Mathematical Formula Recognition (MFR) models to version 1.5. All default configurations, documentation, and examples now use mfd-1.5 and mfr-1.5 as the standard models.

    主要变更:

    • 数学公式检测(MFD)和数学公式识别(MFR)模型升级到 1.5 版本,所有默认配置、文档和示例均以 mfd-1.5 和 mfr-1.5 为标准模型。
  5. v1.1.3.2feat: enhance image processing functions and add comprehensive tests for transparency handling2025-05-07 · 2025-05-07 15:22 UTC
    查看更新说明

    Update 2025.05.06: V1.1.3.2 Released

    Major Changes:

    • Fixed a potential error when processing transparent images, see #171 for details.

    主要变更:

    • 修复了处理透明图片时可能出现的错误,具体见 #171 。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Discord Downloads Visitors license PyPI version forks stars last-release last-commit Twitter

    📖 Doc | 👩🏻‍💻 Online Service | 👨🏻‍💻 Demo | 💬 Contact

    中文 | English

    Pix2Text

    Update 2025.07.25: V1.1.4 Released

    Major Changes:

    • Upgraded the Mathematical Formula Detection (MFD) and Mathematical Formula Recognition (MFR) models to version 1.5. All default configurations, documentation, and examples now use mfd-1.5 and mfr-1.5 as the standard models.

    Update 2025.04.15: V1.1.3 Released

    Major Changes:

    Update 2024.11.17: V1.1.2 Released

    Major Changes:

    • A new layout analysis model DocLayout-YOLO has been integrated, improving the accuracy of layout analysis.

    Update 2024.06.18:V1.1.1 Released

    Major changes:

    • Support the new mathematical formula detection models (MFD): breezedeus/pix2text-mfd (Mirror), which significantly improves the accuracy of formula detection.

    See details: Pix2Text V1.1.1 Released, Bringing Better Mathematical Formula Detection Models | Breezedeus.com.

    Update 2024.04.28: V1.1 Released

    Major changes:

    Update 2024.02.26: V1.0 Released

    Main Changes:

    See more at: RELEASE.md .

    Pix2Text (P2T) aims to be a free and open-source Python alternative to Mathpix, and it can already accomplish Mathpix's core functionality. Pix2Text (P2T) can recognize layouts, tables, images, text, mathematical formulas, and integrate all of these contents into Markdown format. P2T can also convert an entire PDF file (which can contain scanned images or any other format) into Markdown format.

    Pix2Text (P2T) integrates the following models:

    Several models are contributed by other open-source authors, and their contributions are highly appreciated.

    For detailed explanations, please refer to the Pix2Text Online Documentation/Models.

    As a Python3 toolkit, P2T may not be very user-friendly for those who are not familiar with Python. Therefore, we also provide a free-to-use P2T Online Web, where you can directly upload images and get P2T parsing results. The web version uses the latest models, resulting in better performance compared to the open-source models.

    If you're interested, feel free to add the assistant as a friend by scanning the QR code and mentioning p2t. The assistant will regularly invite everyone to join the group where the latest developments related to P2T tools will be announced:

    The author also maintains a Knowledge Planet P2T/CnOCR/CnSTD Private Group, where questions are answered promptly. You're welcome to join. The knowledge planet private group will also gradually release some private materials related to P2T/CnOCR/CnSTD, including some unreleased models, discounts on purchasing premium models, code snippets for different application scenarios, and answers to difficult problems encountered during use. The planet will also publish the latest research materials related to P2T/OCR/STD.

    For more contact method, please refer to Contact.

    List of Supported Languages

    The text recognition engine of Pix2Text supports 80+ languages, including English, Simplified Chinese, Traditional Chinese, Vietnamese, etc. Among these, English and Simplified Chinese recognition utilize the open-source OCR tool CnOCR, while recognition for other languages employs the open-source OCR tool EasyOCR. Special thanks to the respective authors.

    List of Supported Languages and Language Codes are shown below:

    LanguageCode Name
    Abazaabq
    Adygheady
    Afrikaansaf
    Angikaang
    Arabicar
    Assameseas
    Avarava
    Azerbaijaniaz
    Belarusianbe
    Bulgarianbg
    Biharibh
    Bhojpuribho
    Bengalibn
    Bosnianbs
    Simplified Chinesech_sim
    Traditional Chinesech_tra
    Chechenche
    Czechcs
    Welshcy
    Danishda
    Dargwadar
    Germande
    Englishen
    Spanishes
    Estonianet
    Persian (Farsi)fa
    Frenchfr
    Irishga
    Goan Konkanigom
    Hindihi
    Croatianhr
    Hungarianhu
    Indonesianid
    Ingushinh
    Icelandicis
    Italianit
    Japaneseja
    Kabardiankbd
    Kannadakn
    Koreanko
    Kurdishku
    Latinla
    Laklbe
    Lezghianlez
    Lithuanianlt
    Latvianlv
    Magahimah
    Maithilimai
    Maorimi
    Mongolianmn
    Marathimr
    Malayms
    Maltesemt
    Nepaline
    Newarinew
    Dutchnl
    Norwegianno
    Occitanoc
    Palipi
    Polishpl
    Portuguesept
    Romanianro
    Russianru
    Serbian (cyrillic)rs_cyrillic
    Serbian (latin)rs_latin
    Nagpurisck
    Slovaksk
    Sloveniansl
    Albaniansq
    Swedishsv
    Swahilisw
    Tamilta
    Tabassarantab
    Telugute
    Thaith
    Tajiktjk
    Tagalogtl
    Turkishtr
    Uyghurug
    Ukranianuk
    Urduur
    Uzbekuz
    Vietnamesevi

    Ref: Supported Languages .

    Online Service

    Everyone can use the P2T Online Service for free, with a daily limit of 10,000 characters per account, which should be sufficient for normal use. Please refrain from bulk API calls, as machine resources are limited, and this could prevent others from accessing the service.

    Due to hardware constraints, the Online Service currently only supports Simplified Chinese and English languages. To try the models in other languages, please use the following Online Demo.

    Online Demo 🤗

    You can also try the Online Demo to see the performance of P2T in various languages. However, the online demo operates on lower hardware specifications and may be slower. For Simplified Chinese or English images, it is recommended to use the P2T Online Service.

    Examples

    See: Pix2Text Online Documentation/Examples.

    Usage

    See: Pix2Text Online Documentation/Usage.

    Models

    See: Pix2Text Online Documentation/Models.

    Install

    Well, one line of command is enough if it goes well.

    pip install pix2text
    

    If you need to recognize languages other than English and Simplified Chinese, please use the following command to install additional packages:

    pip install pix2text[multilingual]
    

    If the installation is slow, you can specify an installation source, such as using the Aliyun source:

    pip install pix2text -i https://mirrors.aliyun.com/pypi/simple
    

    For more information, please refer to: Pix2Text Online Documentation/Install.

    Command Line Tool

    See: Pix2Text Online Documentation/Command Tool.

    HTTP Service

    See: Pix2Text Online Documentation/Command Tool/Start Service.

    MacOS Desktop Application

    Please refer to Pix2Text-Mac for installing the Pix2Text Desktop App for MacOS.

    A cup of coffee for the author

    It is not easy to maintain and evolve the project, so if it is helpful to you, please consider offering the author a cup of coffee 🥤.


    Official code base: https://github.com/breezedeus/pix2text. Please cite it properly.

    For more information on Pix2Text (P2T), visit: https://www.breezedeus.com/article/pix2text.