Image-Text-to-Text
Transformers
Safetensors
Chinese
English
qwen2_vl
conversational
text-generation-inference
Instructions to use sc22mc/cae with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sc22mc/cae with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="sc22mc/cae") 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("sc22mc/cae") model = AutoModelForMultimodalLM.from_pretrained("sc22mc/cae", 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 sc22mc/cae with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sc22mc/cae" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sc22mc/cae", "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/sc22mc/cae
- SGLang
How to use sc22mc/cae 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 "sc22mc/cae" \ --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": "sc22mc/cae", "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 "sc22mc/cae" \ --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": "sc22mc/cae", "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 sc22mc/cae with Docker Model Runner:
docker model run hf.co/sc22mc/cae
|
Download README.md from sc22mc/cae: direct link, hf CLI and curl.
- Browser
- Download file 17.4 kB
-
https://huggingface.co/sc22mc/cae/resolve/main/README.md
- Command line
-
hf download hf://sc22mc/cae/README.md
-
curl -L -o README.md https://huggingface.co/sc22mc/cae/resolve/main/README.md
17.4 kB
| license: agpl-3.0 | |
| language: | |
| - zh | |
| - en | |
| pipeline_tag: image-text-to-text | |
| library_name: transformers | |
| <div align="center"> | |
| <p align="center"> | |
| <img src="https://raw.githubusercontent.com/opendatalab/MinerU/master/docs/images/MinerU-logo.png" width="300"/> | |
| <p> | |
| <h1 align="center" style="font-size: 28px"> | |
| MinerU2.5: A Decoupled Vision-Language Model for Efficient High-Resolution Document Parsing | |
| </h1> | |
| [](https://github.com/opendatalab/MinerU/) | |
| [](https://huggingface.co/opendatalab/MinerU2.5-2509-1.2B) | |
| [](https://modelscope.cn/models/OpenDataLab/MinerU2.5-2509-1.2B) | |
| [](https://huggingface.co/spaces/opendatalab/MinerU) | |
| [](https://www.modelscope.cn/studios/OpenDataLab/MinerU) | |
| <div align="center"> | |
| <a href="https://mineru.net/OpenSourceTools/Extractor" target="_blank" rel="noopener noreferrer"><strong>๐ Official Demo</strong></a> | | |
| <a href="https://arxiv.org/abs/2509.22186" target="_blank" rel="noopener noreferrer"><strong>๐ Technical Report</strong></a> | |
| </div> | |
| </div> | |
| --- | |
| <p align="center"> | |
| <img alt="Image" src="https://hotelll.github.io/MinerU2.5/performance.jpeg"/> | |
| <p> | |
| # Introduction | |
| <!-- We present **MinerU2.5**, a 1.2B-parameter VLM-based document parsing model that delivers state-of-the-art accuracy with high efficiency. It adopts a coarse-to-fine, two-stage parsing strategy. A large-scale, diverse data engine supports both pretraining and fine-tuning, enabling robust performance across document types. --> | |
| **MinerU2.5** is a 1.2B-parameter vision-language model for document parsing that achieves state-of-the-art accuracy with high computational efficiency. It adopts a two-stage parsing strategy: first conducting efficient global layout analysis on downsampled images, then performing fine-grained content recognition on native-resolution crops for text, formulas, and tables. Supported by a large-scale, diverse data engine for pretraining and fine-tuning, MinerU2.5 consistently outperforms both general-purpose and domain-specific models across multiple benchmarks while maintaining low computational overhead. | |
| ## Key Improvements | |
| <!-- - **More Precise Layout Detection:** Faithfully preserves non-body elements such as headers, footers, and page numbers, ensuring comprehensive content integrity. | |
| - **Significantly Improved Body Text Recognition:** Produces more standardized text formatting with clearly discernible structures for lists, references, and other elements. | |
| - **Breakthroughs in Formula Parsing:** Delivers high-quality parsing of complex, lengthy mathematical formulae and accurately recognizes mixed-language (Chinese-English) equations. | |
| - **Enhanced Robustness in Table Parsing:** Effortlessly handles challenging cases, including rotated tables, borderless tables, and tables with partial borders. --> | |
| - **Comprehensive and Granular Layout Analysis:** It not only preserves non-body elements like headers, footers, and page numbers to ensure full content integrity, but also employs a refined and standardized labeling schema. This enables a clearer, more structured representation of elements such as lists, references, and code blocks. | |
| - **Breakthroughs in Formula Parsing:** Delivers high-quality parsing of complex, lengthy mathematical formulae and accurately recognizes mixed-language (Chinese-English) equations. | |
| - **Enhanced Robustness in Table Parsing:** Effortlessly handles challenging cases, including rotated tables, borderless tables, and tables with partial borders. | |
| # Quick Start | |
| For convenience, we provide `mineru-vl-utils`, a Python package that simplifies the process of sending requests and handling responses from MinerU2.5 Vision-Language Model. Here we give some examples to use MinerU2.5. For more information and usages, please refer to [mineru-vl-utils](https://github.com/opendatalab/mineru-vl-utils/tree/main). | |
| ๐ We strongly recommend using vllm for inference, as the `vllm-async-engine` can achieve a concurrent inference speed of **2.12 fps** on one A100. | |
| ## Install packages | |
| ```bash | |
| # For `transformers` backend | |
| pip install "mineru-vl-utils[transformers]" | |
| # For `vllm-engine` and `vllm-async-engine` backend | |
| pip install "mineru-vl-utils[vllm]" | |
| ``` | |
| ## `transformers` Example | |
| ```python | |
| from transformers import AutoProcessor, Qwen2VLForConditionalGeneration | |
| from PIL import Image | |
| from mineru_vl_utils import MinerUClient | |
| # for transformers>=4.56.0 | |
| model = Qwen2VLForConditionalGeneration.from_pretrained( | |
| "opendatalab/MinerU2.5-2509-1.2B", | |
| dtype="auto", # use `torch_dtype` instead of `dtype` for transformers<4.56.0 | |
| device_map="auto" | |
| ) | |
| processor = AutoProcessor.from_pretrained( | |
| "opendatalab/MinerU2.5-2509-1.2B", | |
| use_fast=True | |
| ) | |
| client = MinerUClient( | |
| backend="transformers", | |
| model=model, | |
| processor=processor | |
| ) | |
| image = Image.open("/path/to/the/test/image.png") | |
| extracted_blocks = client.two_step_extract(image) | |
| print(extracted_blocks) | |
| ``` | |
| ## `vllm-engine` Example (Recommended!) | |
| ```python | |
| from vllm import LLM | |
| from PIL import Image | |
| from mineru_vl_utils import MinerUClient | |
| from mineru_vl_utils import MinerULogitsProcessor # if vllm>=0.10.1 | |
| llm = LLM( | |
| model="opendatalab/MinerU2.5-2509-1.2B", | |
| logits_processors=[MinerULogitsProcessor] # if vllm>=0.10.1 | |
| ) | |
| client = MinerUClient( | |
| backend="vllm-engine", | |
| vllm_llm=llm | |
| ) | |
| image = Image.open("/path/to/the/test/image.png") | |
| extracted_blocks = client.two_step_extract(image) | |
| print(extracted_blocks) | |
| ``` | |
| ## `vllm-async-engine` Example (Recommended!) | |
| ```python | |
| import io | |
| import asyncio | |
| import aiofiles | |
| from vllm.v1.engine.async_llm import AsyncLLM | |
| from vllm.engine.arg_utils import AsyncEngineArgs | |
| from PIL import Image | |
| from mineru_vl_utils import MinerUClient | |
| from mineru_vl_utils import MinerULogitsProcessor # if vllm>=0.10.1 | |
| async_llm = AsyncLLM.from_engine_args( | |
| AsyncEngineArgs( | |
| model="opendatalab/MinerU2.5-2509-1.2B", | |
| logits_processors=[MinerULogitsProcessor] # if vllm>=0.10.1 | |
| ) | |
| ) | |
| client = MinerUClient( | |
| backend="vllm-async-engine", | |
| vllm_async_llm=async_llm, | |
| ) | |
| async def main(): | |
| image_path = "/path/to/the/test/image.png" | |
| async with aiofiles.open(image_path, "rb") as f: | |
| image_data = await f.read() | |
| image = Image.open(io.BytesIO(image_data)) | |
| extracted_blocks = await client.aio_two_step_extract(image) | |
| print(extracted_blocks) | |
| asyncio.run(main()) | |
| async_llm.shutdown() | |
| ``` | |
| # Model Architecture | |
| <p align="center"> | |
| <img alt="Image" src="https://hotelll.github.io/MinerU2.5/Mineru25_framework.jpeg"/> | |
| <p> | |
| # Performance on OmniDocBench | |
| ## Across Different Elements | |
| <p align="center"> | |
| <img alt="Image" src="https://hotelll.github.io/MinerU2.5/omnidocbench_element.jpeg"/> | |
| <p> | |
| ## Across Various Document Types | |
| <p align="center"> | |
| <img alt="Image" src="https://hotelll.github.io/MinerU2.5/omnidocbench_type.jpeg"/> | |
| <p> | |
| # Case Demonstration | |
| ## Full-Document Parsing across Various Doc-Types | |
| <p align="center"> | |
| <img alt="Image" src="https://hotelll.github.io/MinerU2.5/PDF-Type-1_page_1.png"/> | |
| <p> | |
| <p align="center"> | |
| <img alt="Image" src="https://hotelll.github.io/MinerU2.5/PDF-Type-2_page_1.png"/> | |
| <p> | |
| <p align="center"> | |
| <img alt="Image" src="https://hotelll.github.io/MinerU2.5//PDF-Type-3_page_1.png"/> | |
| <p> | |
| ## Table Recognition | |
| <p align="center"> | |
| <img alt="Image" src="https://hotelll.github.io/MinerU2.5/Table-Module-1_page_1.png"/> | |
| <p> | |
| <p align="center"> | |
| <img alt="Image" src="https://hotelll.github.io/MinerU2.5/Table-Module-2_page_1.png"/> | |
| <p> | |
| ## Formula Recognition | |
| <p align="center"> | |
| <img alt="Image" src="https://hotelll.github.io/MinerU2.5/Formula-Module-1_page_1.png"/> | |
| <p> | |
| <p align="center"> | |
| <img alt="Image" src="https://hotelll.github.io/MinerU2.5/Formula-Module-2_page_1.png"/> | |
| <p> | |
| # Acknowledgements | |
| We would like to thank [Qwen Team](https://github.com/QwenLM), [vLLM](https://github.com/vllm-project/vllm), [OmniDocBench](https://github.com/opendatalab/OmniDocBench), [UniMERNet](https://github.com/opendatalab/UniMERNet), [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR), [DocLayout-YOLO](https://github.com/opendatalab/DocLayout-YOLO) for providing valuable code and models. We also appreciate everyone's contribution to this open-source project! | |
| # Citation | |
| If you find our work useful in your research, please consider giving a star โญ and citation ๐ : | |
| ```BibTeX | |
| @misc{niu2025mineru25decoupledvisionlanguagemodel, | |
| title={MinerU2.5: A Decoupled Vision-Language Model for Efficient High-Resolution Document Parsing}, | |
| author={Junbo Niu and Zheng Liu and Zhuangcheng Gu and Bin Wang and Linke Ouyang and Zhiyuan Zhao and Tao Chu and Tianyao He and Fan Wu and Qintong Zhang and Zhenjiang Jin and others}, | |
| year={2025}, | |
| eprint={2509.22186}, | |
| archivePrefix={arXiv}, | |
| primaryClass={cs.CV}, | |
| url={https://arxiv.org/abs/2509.22186}, | |
| } | |
| ``` |