Repolode
baidu

baidu/Unlimited-OCR

Baidu's open-source vision-language OCR model that parses long, multi-page documents and PDFs into structured text in one pass.

Stars
30,841
Forks
3,300
Open issues
91
Last commit
6 days ago

What is it?

Unlimited OCR is a document parsing model from Baidu, built as a successor to DeepSeek-OCR. It targets long, multi-page documents and aims to convert them into structured text in a single inference pass, rather than processing each page separately.

The repository provides inference code on top of Hugging Face Transformers for NVIDIA GPUs, with single-image, multi-page, and PDF modes. For PDFs, pages are rendered to images with PyMuPDF before parsing. Serving is also supported through vLLM (with official Docker images) and SGLang, which exposes an OpenAI-compatible streaming API. A batch script, infer.py, runs concurrent requests over an image directory or PDF.

The project includes post-processing code for OmniDocBench evaluation that strips layout markers from raw output. Model weights are published on Hugging Face and ModelScope.

Key features

  • 01Parses long, multi-page documents in one inference pass.
  • 02Supports single images, multi-page image sets, and PDFs.
  • 03Runs with Hugging Face Transformers, vLLM, or SGLang.
  • 04Provides an OpenAI-compatible streaming API through SGLang.
  • 05Includes a batch inference script for directories and PDFs.

Use cases

  • Converting scanned multi-page PDFs into structured text.
  • Building document ingestion pipelines for retrieval or LLM workflows.
  • Benchmarking document parsing on OmniDocBench.
  • Serving a document OCR model behind an internal API.

Quick start

  1. 1

    Install the Python dependencies listed in the README (Transformers route, tested on Python 3.12 with CUDA 12.9)

    pip install torch==2.10.0 torchvision==0.25.0 transformers==4.57.1 Pillow==12.1.1 matplotlib==3.10.8 einops==0.8.2 addict==2.4.0 easydict==1.13 pymupdf==1.27.2.2 psutil==7.2.2
  2. 2

    Load the model from Hugging Face with AutoModel and AutoTokenizer, then run model.infer on an image in a Python script

Things to know

  • Transformers inference is tested on NVIDIA GPUs with CUDA, so a GPU is needed.
  • Multi-page and PDF parsing only use the base configuration.
  • The README covers a specific tested setup (Python 3.12, CUDA 12.9), so other environments may need adjustment.

In collections

Topics

FAQ

What is Unlimited-OCR?
Baidu's open-source vision-language OCR model that parses long, multi-page documents and PDFs into structured text in one pass. Unlimited OCR is a document parsing model from Baidu, built as a successor to DeepSeek-OCR. It targets long, multi-page documents and aims to convert them into structured text in a single inference pass, rather than processing each page separately.
Is Unlimited-OCR free to use? What license does it have?
Unlimited-OCR is open source under the MIT license. Check the license terms before using it in commercial products.
Is Unlimited-OCR still maintained?
Actively maintained. The last commit to Unlimited-OCR was on Nov 2, 2026.
What can I use Unlimited-OCR for?
Converting scanned multi-page PDFs into structured text. Building document ingestion pipelines for retrieval or LLM workflows. Benchmarking document parsing on OmniDocBench. Serving a document OCR model behind an internal API.
How do I install Unlimited-OCR?
Install the Python dependencies listed in the README (Transformers route, tested on Python 3.12 with CUDA 12.9): pip install torch==2.10.0 torchvision==0.25.0 transformers==4.57.1 Pillow==12.1.1 matplotlib==3.10.8 einops==0.8.2 addict==2.4.0 easydict==1.13 pymupdf==1.27.2.2 psutil==7.2.2 Load the model from Hugging Face with AutoModel and AutoTokenizer, then run model.infer on an image in a Python script
Where can I get Unlimited-OCR?
The source code and installation instructions are on GitHub: https://github.com/baidu/Unlimited-OCR

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects