How baidu/unlimited-ocr works
This repository provides a practical Unlimited OCR 2 inference and output-conversion workflow, rather than the OCR model implementation itself. Users submit ordered page images through the SGLang client, receive raw OCR output, and can convert that output to Markdown. The README also documents native Transformers inference and the model’s multi-page and ultra-long-document capabilities. The graph reflects the sampled client and converter; model internals and the unsampled portions of conversion are not mapped in detail.
Main entry points: infer.py Document inference · process_unlimitedOCR2.py OCR conversion · README.md Transformers inference
Components 8
Inference workflow
- Document inference
infer.py - Raw OCR text
Model serving
- SGLang server
- Transformers inference
README.md
Output conversion
- OCR conversion
utils/process_unlimitedOCR2.py - Markdown output
Other components
- OCR user
- Page images
Connections 8
- OCR user → Document inference: runs
infer.py - Page images → Document inference: reads pages
infer.py - Document inference → SGLang server: posts request
infer.py - SGLang server → Document inference: returns OCR
infer.py - Document inference → Raw OCR text: writes text
infer.py - OCR user → Transformers inference: loads model
README.md - Raw OCR text → OCR conversion: converts
utils/process_unlimitedOCR2.py - OCR conversion → Markdown output: renders
utils/process_unlimitedOCR2.py