Unlimited-OCR
Unlimited-OCR is an open-source long-document OCR parsing project from Baidu, aimed at advancing OCR into the era of "unlimited vision" parsing. Its second generation, Unlimited OCR 2, introduces Sparse Reference Sliding Window Attention (SR-SWA), which compresses text-vision attention interactions into a fixed-size working reference set (e.g., 512 tokens), thereby enabling unbounded document parsing within a limited context window and avoiding quadratic attention growth and memory bottlenecks. The project supports quick testing with Transformers and service deployment with SGLang, provides multi-page inference (infer_multi) and single-page inference (infer) interfaces, and includes a batch client and post-processing tools. The model is available on platforms such as ModelScope and Baidu AI Cloud, and is suitable for end-to-end parsing of ultra-long documents, books, multi-page scans, and similar scenarios.