What do you want to do?
3 use cases
-
Parse a long multi-page scan with cross-page context
Load Unlimited OCR 2 in Transformers and parse all pages of a document in one request.
View prompt
Using baidu/Unlimited-OCR-2 in Transformers as the README shows, convert <document.pdf> to page images, run infer_multi over all pages, and save the text to output/multi. Report token count and any pages that look wrong.
-
Serve Unlimited OCR 2 with SGLang for hundred-page PDFs
Set up the customized SGLang build and run a server tuned for very long documents.
View prompt
Set up baidu/Unlimited-OCR's SGLang server following the README exactly, with page windows of 10, then parse <long.pdf> through it and tell me peak GPU memory and time per page.
-
Compare your OCR pipeline on the MarathonDocBench ultra-long benchmark
Use Baidu's new MarathonDocBench dataset to test how your current OCR handles very long documents.
View prompt
Download baidu/MarathonDocBench, pick 5 long documents, run both <my OCR tool> and baidu/Unlimited-OCR-2 (infer_multi) on them, and write a comparison of where each fails.
What people are building with Unlimited OCR
-
Benchmarkthe web
Tested Unlimited OCR on real bank statements and a 51 line parser won on exact cents
On three statements with 560 transactions, Unlimited OCR recovered 0 to 66 percent of amounts to the cent at 10 to 40 seconds a page, while a pdftotext parser with a reconciliation check got all of them. Page by page beat whole document mode.
By Jon Roosevelt (jonroosevelt.com) on the web
-
BenchmarkDEV
Benchmarked Unlimited-OCR 2 on a 16 GB RTX 4070 Ti SUPER against Chandra 2, Marker and Tesseract
On 20 pages of a Central Bank of Chile report it scored a 0.12 percent median character error rate, tying Chandra 2. With transformers it ran out of memory at 80 pages; Baidu's SGLang kept time per token flat but its window mode hung.
By Efrain Garay (@efraingaray) on DEV
Real builds shared on X, Hacker News, Reddit, DEV and GitHub, summed up by Deduped from each post and its links; each card links to the original post. See what people are building with other repos
Quick start with Unlimited OCR
- Check you have what it needs: An NVIDIA GPU (tested on an A800 80GB) with CUDA; Python 3.10 with torch 2.13.0 and transformers 4.52.1, or uv for the SGLang setup; PyMuPDF to convert PDFs to page images.
- Open baidu/Unlimited-OCR on GitHub and read the README and license.
- Install the tested versions with
pip install torch==2.13.0 torchvision pillow transformers==4.52.1 huggingface-hub==0.36.0plus the other pinned packages in the README - Load baidu/Unlimited-OCR-2 with AutoModel and AutoTokenizer using trust_remote_code=True and bfloat16 on CUDA
- Convert your document to page images in page order
- Call model.infer_multi with image_files set to the pages and save_results=True
These steps come from our top use case, Parse a long multi-page scan with cross-page context, which also has a copy-paste agent prompt.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for baidu/Unlimited-OCR
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeAbout this repo
- Who it is forML engineers and data teams who need to turn long scanned PDFs and reports into text at scale.
- Why it is hot30k stars, talked about in 3 AI sources we track
- LanguagePython
- Sourcegithub.com/baidu/Unlimited-OCR ยท Back to Hot repos
Requirements
- An NVIDIA GPU (tested on an A800 80GB) with CUDA
- Python 3.10 with torch 2.13.0 and transformers 4.52.1, or uv for the SGLang setup
- PyMuPDF to convert PDFs to page images
Add this badge to your README
Maintain Unlimited OCR? Show readers where to find these use cases.
Markdown
[](https://dedupedai.com/use-cases/baidu-unlimited-ocr/?utm_source=github&utm_medium=badge&utm_campaign=baidu-Unlimited-OCR)
HTML
<a href="https://dedupedai.com/use-cases/baidu-unlimited-ocr/?utm_source=github&utm_medium=badge&utm_campaign=baidu-Unlimited-OCR"><img src="https://dedupedai.com/badge/baidu/Unlimited-OCR.svg" alt="Use cases on Deduped" height="20"></a>
A static image, no tracking script. About the badge
Questions about Unlimited OCR
What is Unlimited OCR?
Unlimited OCR 2 is Baidu's open OCR model for ultra-long document parsing. Sparse Reference Sliding Window Attention lets it parse documents of any length within a finite context window, with multi-page inference that uses cross-page context. It runs with Hugging Face Transformers for quick tests and a customized SGLang server for serving, and has a Hugging Face Spaces demo. It is an open-source project on GitHub: https://github.com/baidu/Unlimited-OCR.
How do I use Unlimited OCR?
Install the tested versions with pip install torch==2.13.0 torchvision pillow transformers==4.52.1 huggingface-hub==0.36.0 plus the other pinned packages in the README; then load baidu/Unlimited-OCR-2 with AutoModel and AutoTokenizer using trust_remote_code=True and bfloat16 on CUDA; Convert your document to page images in page order. The use cases on this page give the full steps and a copy-paste agent prompt for each job.
Who is Unlimited OCR for?
ML engineers and data teams who need to turn long scanned PDFs and reports into text at scale.
What can I do with Unlimited OCR?
3 use cases so far, for example: Parse a long multi-page scan with cross-page context; Serve Unlimited OCR 2 with SGLang for hundred-page PDFs; Compare your OCR pipeline on the MarathonDocBench ultra-long benchmark. Each has steps and a copy-paste agent prompt.
What do I need to run Unlimited OCR?
An NVIDIA GPU (tested on an A800 80GB) with CUDA; Python 3.10 with torch 2.13.0 and transformers 4.52.1, or uv for the SGLang setup; PyMuPDF to convert PDFs to page images.
What are alternatives to Unlimited OCR?
Other hot AI repos in Data and analytics: Helix Foundry, DBX, Brandpose, Edit Drift, Image Pipes.
Is Unlimited OCR safe to run?
Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.