Unlimited OCR Works: Welcome the Era of One-shot Long-horizon Parsing.
Unlimited OCR Works: Welcome the Era of One-shot Long-horizon Parsing.
Inference using Huggingface transformers on NVIDIA GPUs. Requirements tested on python 3.12.3 + CUDA12.9:
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…Please refer to the official vLLM recipe for deployment details:
Recipe: https://recipes.vllm.ai/baidu/Unlimited-OCR
Use the following Docker images depending on your GPU platform:
Default (CUDA 13.0):
docker pull vllm/vllm-openai:unlimited-ocrFor Hopper GPUs (CUDA 12.9)
docker pull vllm/vllm-openai:unlimited-ocr-cu129Set up the environment (uv-managed virtualenv). Install the local SGLang wheel first,
then pin kernels==0.9.0 and install PyMuPDF for PDF-to-image conversion:
uv venv --python 3.12
source .venv/bin/activate
uv pip install wheel/sglang-0.0.0.dev11416+g92e8bb79e-py3-none-any.whl
uv pip install kernels==0.11.7
uv pip install pymupdf==1.27.2.2Start the SGLang server:
python -m sglang.launch_server \
--model baidu/Unlimited-OCR \
--served-model-name Unlimited-OCR \
--attention-backend fa3 \
--page-size 1 \
--mem-fraction-static 0.8 \
--context-length 32768 \
--enable-custom-logit-processor \
--disable-overlap-schedule \
--skip-server-warmup \
--host 0.0.0.0 \
--port 10000Send streaming requests to the OpenAI-compatible API:
…For batch inference, infer.py starts the SGLang server automatically and sends concurrent requests for an image directory or PDF:
# Image directory
python infer.py \
--image_dir ./examples/images \
--output_dir ./outputs \
--concurrency 8 \
--image_mode gundam
# PDF pages
python infer.py \
--pdf ./examples/document.pdf \
--output_dir ./outputs \
--concurrency 8 \
--image_mode gundamUseful options:
--model_dir baidu/Unlimited-OCR # Local path or Hugging Face model ID
--gpu 0 # CUDA_VISIBLE_DEVICES value
--server_log ./log/sglang_server.logFor OmniDocBench evaluation, you need to perform the following post-processing.
…We would like to thank Deepseek-OCR, Deepseek-OCR-2, PaddleOCR for their valuable models and ideas.
@misc{yin2026unlimitedocrworks,
title={Unlimited OCR Works},
author={Youyang Yin and Huanhuan Liu and YY and Qunyi Xie and Chaorun Liu and Shiqi Yang and Shaohua Wang and Zhanlong Liu and Hao Zou and Jinyue Chen and Shu Wei and Jingjing Wu and Mingxin Huang and Zhen Wu and Guibin Wang and Tengyu Du and Lei Jia},
year={2026},
eprint={2606.23050},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2606.23050},
}R&D feedback: model is 8-19x slower than Tesseract per page, even on GPU - too heavy for our lightweight ingestion pipeline
Docs request: community-tested Intel Arc A770/Vulkan single-page starter path (GGUF)
Non-CUDA inference: CPU works after removing hardcoded .cuda(); MPS (Apple Silicon) crashes mid-generation
Your project is on StackMap — a curated map of the AI stack
[Feature Request] Add Agent skill/tool integration interface for OCR capability
Output texts keeps on repeating infinitely [Tried with llama.cpp server running on ubuntu 22.04]
Apple Silicon (MPS): empty output — masked_scatter with a broadcast mask scatters incorrectly on Metal
ArabicOCR
Is the source code for the Hugging Face Spaces web demo available?
模型推理部署