Home

Awesome

<div align="center"> <img src="./docs/figs/p2t-logo.png" width="250px"/> <div>&nbsp;</div>

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

πŸ“– Doc | πŸ‘©πŸ»β€πŸ’» Online Service | πŸ‘¨πŸ»β€πŸ’» Demo | πŸ’¬ Contact

</div> <div align="center">

δΈ­ζ–‡ | English

</div>

Pix2Text

Update 2024.11.17: V1.1.2 Released

Major Changes:

Update 2024.06.18:V1.1.1 Released

Major changes:

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 .

<br/>

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.

<div align="center"> <img src="docs/figs/arch-flow.jpg" alt="Pix2Text Arch Flow"/> </div>

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

<br/>

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:

<div align="center"> <img src="https://pix2text.readthedocs.io/zh-cn/stable/figs/wx-qr-code.JPG" alt="Wechat-QRCode" width="300px"/> </div>

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:

<details> <summary>↓↓↓ Click to show details ↓↓↓</summary>
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 .

</details>

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.

<div align="center"> <img src="https://github.com/breezedeus/Pix2Text-Mac/raw/main/assets/on_menu_bar.jpg" alt="Pix2Text Mac App" width="400px"/> </div>

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.