Instructions to use SeerRay-Lab/Xiaomi-OCR-0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SeerRay-Lab/Xiaomi-OCR-0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="SeerRay-Lab/Xiaomi-OCR-0") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("SeerRay-Lab/Xiaomi-OCR-0") model = AutoModelForMultimodalLM.from_pretrained("SeerRay-Lab/Xiaomi-OCR-0", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SeerRay-Lab/Xiaomi-OCR-0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SeerRay-Lab/Xiaomi-OCR-0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SeerRay-Lab/Xiaomi-OCR-0", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/SeerRay-Lab/Xiaomi-OCR-0
- SGLang
How to use SeerRay-Lab/Xiaomi-OCR-0 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "SeerRay-Lab/Xiaomi-OCR-0" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SeerRay-Lab/Xiaomi-OCR-0", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "SeerRay-Lab/Xiaomi-OCR-0" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SeerRay-Lab/Xiaomi-OCR-0", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use SeerRay-Lab/Xiaomi-OCR-0 with Docker Model Runner:
docker model run hf.co/SeerRay-Lab/Xiaomi-OCR-0
Add Real5-OmniDocBench evaluation results for Xiaomi-OCR-0
Real5-OmniDocBench evaluation results for Xiaomi-OCR-0
This PR adds the evaluation file for Xiaomi-OCR-0 under the Hugging Face evaluation-results workflow.
This is based on the new evaluation results feature: https://huggingface.co/docs/hub/eval-results.
Dataset
File
.eval_results/real5_omnidocbench.yaml
Evaluation details
Real5-OmniDocBench is fully aligned with OmniDocBench V1.5. Therefore, the evaluation must be performed using the v1.5 branch of OmniDocBench. The evaluation code in the V1.6 branch has undergone substantial changes, and results produced with that branch are not directly comparable with those of other models on the existing leaderboard.
This version difference is also the primary reason for any significant discrepancy between the official evaluation results and independently obtained results produced using the V1.6 branch.
Tasks
- overall
- scanning
- warping
- screen_photography
- illumination
- skew
Hi @changdazhou , thank you for your interest in Xiaomi-OCR-0 and for sharing your evaluation results!
Our reported document parsing results use a two-stage pipeline: PP-DocLayoutV3 (PaddleX, threshold 0.25) detects the layout regions, and Xiaomi-OCR-0 recognizes those regions before assembling the page-level Markdown. Your results may correspond to direct end-to-end inference; could you confirm which pipeline you used?
We have added the inference scripts, evaluation configuration, and reference results to our evaluation guide. Our Real5-OmniDocBench results are:
| Method | Overall ↑ | Scanning ↑ | Warping ↑ | Screen-Photo ↑ | Illumination ↑ | Skew ↑ |
|---|---|---|---|---|---|---|
| End-to-end | 93.45 | 94.524 | 93.401 | 93.279 | 93.858 | 92.170 |
| Two-stage with PP-DocLayoutV3 | 95.24 | 96.41 | 95.46 | 94.47 | 95.39 | 94.46 |
These reference results were evaluated using OmniDocBench v1.6. Your results appear close to those we obtained by using Xiaomi-OCR-0 directly in an end-to-end setup, although our scores are somewhat higher. Differences in the evaluator version or vLLM inference parameters may contribute to this gap; we have also documented our inference parameters in detail in the evaluation guide.
We hope the published evaluation guide and configuration help you reproduce our results. We would appreciate your feedback if you still observe a discrepancy. Thank you!
Thanks for your reply.
The inference approach I used is exactly Two-stage with PP-DocLayoutV3, running the inference code provided in the repo. The fact that it comes close to your end-to-end evaluation result is just a coincidence.The discrepancy comes from your using the OmniDocBench v1.6 evaluation code — we've reached the same conclusion when evaluating other models. Could you re-run the evaluation with the code on the OmniDocBench v1_5 branch?
Alternatively, feel free to share your inference outputs and we'll run the evaluation on our side. Thanks!
Thanks for clarifying your inference setup, and apologies for our earlier assumption.
We have shared our original two-stage inference outputs here: Download the predictions. The archive contains page-level Markdown predictions for all five Real5-OmniDocBench subsets.
Could you evaluate these outputs and share the updated results with us? Thank you!
Hi @loongwayX , thanks for sharing the original two-stage inference outputs!
We have now evaluated the page-level Markdown predictions you provided for all five Real5-OmniDocBench subsets (1,355 pages per subset) using our OmniDocBench v1.5 evaluation setup.
The results are:
| Method / evaluation setup | Overall ↑ | Scanning ↑ | Warping ↑ | Screen-Photo ↑ | Illumination ↑ | Skew ↑ |
|---|---|---|---|---|---|---|
| Your shared two-stage predictions / OmniDocBench v1.5 | 92.7863 | 93.7938 | 92.8002 | 92.8232 | 92.7919 | 91.7222 |
Overall is the arithmetic mean of the five subset scores. These results are broadly consistent with the corresponding metrics I originally submitted in this PR.
For reproducibility and further inspection, the full evaluation artifacts, including the detailed metrics and per-sample results, are available here:
Download the evaluation results
The archive is organized into five directories: Illumination/, Scanning/, Screen/, Skew/, and Warping/.
Real5-OmniDocBench is currently strictly aligned with OmniDocBench V1.5, so our evaluation continues to use the code from OmniDocBench's v1_5 branch. This alignment ensures that results remain consistent and directly comparable on the current benchmark.
Going forward, we will continue to expand the dataset and align Real5-OmniDocBench with newer versions of OmniDocBench. We look forward to your continued interest and feedback. Thanks again for sharing the predictions and supporting reproducible evaluation!