AIDC-AI / OvisOCR

huggingface.co
Total runs: 326
24-hour runs: 0
7-day runs: 40
30-day runs: 320
Model's Last Updated: June 09 2026
image-text-to-text

Introduction of OvisOCR

Model Details of OvisOCR

OvisOCR

Ovis

Introduction

We introduce OvisOCR , a lightweight end-to-end multimodal large language model (MLLM) tailored for high-fidelity document parsing. Unlike conventional Crop-OCR-Merge systems that rely on layout detection, localized cropping, specialized recognizers, and heuristic merging, OvisOCR directly maps full-page document images into structured Markdown outputs.

OvisOCR is designed for information-dense documents containing natural language text, tables, mathematical formulas, figures, and complex layouts. It preserves fine-grained textual fidelity while maintaining global document structure and human reading order. With only 1.3B parameters , OvisOCR achieves outstanding overall performance on OmniDocBench v1.5.

benchmark

Key Features
  • Strictly End-to-End Document Parsing
    OvisOCR directly maps full-page visual signals to structured Markdown without localized slicing, layout-dependent recognition, or post-hoc merging. This streamlined paradigm reduces error propagation and improves global serialization consistency.

  • Synergistic Data Construction
    Our data construction pipeline builds high-quality supervision by combining the strengths of a specialized OCR engine and a general-purpose MLLM. The specialized perceiver supplies dense local evidence, while the general reasoner checks for hallucinations, content completeness, table validity, formula syntax, and logical reading order.

  • Multi-Granularity Alignment
    OvisOCR uses element-aware optimization for heterogeneous document constituents. Text, tables, and formulas are optimized with tailored reward signals, including edit-distance-based text fidelity, TEDS-based table similarity, and CDM-based formula visual correctness.

  • Strong Document Parsing Capability with Compact Scale
    With only 1.3B parameters, OvisOCR achieves outstanding performance on OmniDocBench v1.5, surpassing strong specialized parsers, large general MLLMs, and traditional pipeline tools.

OvisOCR

Inference
pip install "vllm==0.18.1" pillow
from PIL import Image
from vllm import LLM, SamplingParams


class OvisOCRParser:
    def __init__(self, model_name_or_path: str):
        self.model = LLM(
            model=model_name_or_path,
            tensor_parallel_size=1,
            trust_remote_code=True,
            gpu_memory_utilization=0.8,
        )

        prompt = 'Extract all readable content from the image in natural human reading order and output the result as a single Markdown document. For charts or images, represent them using an HTML image tag: <' + 'img src="images/bbox_{left}_{top}_{right}_{bottom}.jpg" />, where left, top, right, bottom are bounding box coordinates scaled to [0, 1000). Format formulas as LaTeX. Format tables as HTML: <table>...</table>. Transcribe all other text as standard Markdown. Preserve the original text without translation or paraphrasing.'
        self.prompt = self.model.get_tokenizer().apply_chat_template(
            [{"role": "user", "content": f"<image>\n{prompt}"}],
            tokenize=False,
            add_generation_prompt=True,
            enable_thinking=False
        )

        self.sampling_params = SamplingParams(
            max_tokens=16384,
            temperature=0.0,
        )

    def _clean_truncated_repeats(
        self,
        text: str,
        min_text_len: int = 8000,
        max_period: int = 200,
        min_period: int = 1,
        min_repeat_chars: int = 100,
        min_repeat_times: int = 5
    ) -> str:
        n = len(text)
        if n < min_text_len:
            return text

        max_period = min(max_period, n - 1)
        for unit_len in range(min_period, max_period + 1):
            if text[n - 1] != text[n - 1 - unit_len]:
                continue

            match_len = 1
            idx = n - 2
            while idx >= unit_len and text[idx] == text[idx - unit_len]:
                match_len += 1
                idx -= 1

            total_len = match_len + unit_len
            repeat_times = total_len // unit_len
            tail_len = total_len % unit_len

            if repeat_times >= min_repeat_times and total_len >= min_repeat_chars:
                return text[: n - total_len + unit_len] + text[n - tail_len:]

        return text

    def parse(self, images: list[Image.Image], filter_imgtags: bool = True) -> list[str]:
        vllm_inputs = [
            {
                "prompt": self.prompt,
                "multi_modal_data": {"image": image},
                "mm_processor_kwargs": {
                    "images_kwargs": {
                        "min_pixels": 448 * 448,
                        "max_pixels": 2880 * 2880,
                    }
                }
            }
            for image in images
        ]

        outputs = self.model.generate(vllm_inputs, self.sampling_params)

        markdowns = []
        for output in outputs:
            text = output.outputs[0].text.strip()
            if filter_imgtags:
                text = "\n\n".join(
                    block
                    for block in text.split("\n\n")
                    if not block.strip().startswith('<img src="images/bbox_')
                )
            markdowns.append(self._clean_truncated_repeats(text))

        return markdowns


if __name__ == "__main__":
    parser = OvisOCRParser("AIDC-AI/OvisOCR")
    images = [Image.open("test1.jpg"), Image.open("test2.jpg")]
    markdowns = parser.parse(images)
    print(markdowns[0])
Citation

If you find OvisOCR useful, please consider citing our paper:

@inproceedings{jiang2026ovisocr,
  title = {{OvisOCR}: End-to-End Document Parsing via Aligning Specialized Perception with General Reasoning},
  author = {Jiang, Jun-Peng and Lu, Shiyin and Ji, An-Yang and Li, Yinglun and Chen, Qing-Guo and Xu, Zhao and Luo, Weihua and Zhang, Kaifu and Zhan, De-Chuan and Ye, Han-Jia},
  booktitle = {Proceedings of the 43rd International Conference on Machine Learning},
  series = {Proceedings of Machine Learning Research},
  volume = {306},
  address = {Seoul, South Korea},
  publisher = {PMLR},
  year = {2026}
}
License

This project is licensed under the Apache License, Version 2.0 (SPDX-License-Identifier: Apache-2.0).

Disclaimer

We used automated filtering and quality-assurance procedures during data construction to reduce parsing errors such as repeated hallucinations, incomplete content, invalid table/formula structures, and reading-order inconsistencies. Due to the diversity and complexity of real-world documents, OvisOCR may still produce incorrect or incomplete outputs. Please manually verify results in critical applications.

Runs of AIDC-AI OvisOCR on huggingface.co

326
Total runs
0
24-hour runs
8
3-day runs
40
7-day runs
320
30-day runs

More Information About OvisOCR huggingface.co Model

More OvisOCR license Visit here:

https://choosealicense.com/licenses/apache-2.0

OvisOCR huggingface.co

OvisOCR huggingface.co is an AI model on huggingface.co that provides OvisOCR's model effect (), which can be used instantly with this AIDC-AI OvisOCR model. huggingface.co supports a free trial of the OvisOCR model, and also provides paid use of the OvisOCR. Support call OvisOCR model through api, including Node.js, Python, http.

AIDC-AI OvisOCR online free

OvisOCR huggingface.co is an online trial and call api platform, which integrates OvisOCR's modeling effects, including api services, and provides a free online trial of OvisOCR, you can try OvisOCR online for free by clicking the link below.

AIDC-AI OvisOCR online free url in huggingface.co:

https://huggingface.co/AIDC-AI/OvisOCR

OvisOCR install

OvisOCR is an open source model from GitHub that offers a free installation service, and any user can find OvisOCR on GitHub to install. At the same time, huggingface.co provides the effect of OvisOCR install, users can directly use OvisOCR installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

OvisOCR install url in huggingface.co:

https://huggingface.co/AIDC-AI/OvisOCR

Url of OvisOCR

OvisOCR huggingface.co Url

Provider of OvisOCR huggingface.co

AIDC-AI
ORGANIZATIONS

Other API from AIDC-AI

huggingface.co

Total runs: 117.5K
Run Growth: 4.7K
Growth Rate: 3.98%
Updated:August 15 2025
huggingface.co

Total runs: 18.8K
Run Growth: 14.3K
Growth Rate: 76.35%
Updated:February 13 2026
huggingface.co

Total runs: 12.5K
Run Growth: -13.7K
Growth Rate: -109.21%
Updated:February 13 2026
huggingface.co

Total runs: 11.3K
Run Growth: -35.3K
Growth Rate: -312.00%
Updated:August 15 2025
huggingface.co

Total runs: 1.6K
Run Growth: 0
Growth Rate: 0.00%
Updated:February 26 2025
huggingface.co

Total runs: 1.4K
Run Growth: 270
Growth Rate: 19.58%
Updated:March 04 2025
huggingface.co

Total runs: 982
Run Growth: -45.0K
Growth Rate: -4582.28%
Updated:August 15 2025
huggingface.co

Total runs: 688
Run Growth: 387
Growth Rate: 56.25%
Updated:August 15 2025
huggingface.co

Total runs: 426
Run Growth: -476
Growth Rate: -111.74%
Updated:July 03 2025
huggingface.co

Total runs: 398
Run Growth: -7
Growth Rate: -1.76%
Updated:November 23 2024
huggingface.co

Total runs: 300
Run Growth: -37
Growth Rate: -12.33%
Updated:August 15 2025
huggingface.co

Total runs: 59
Run Growth: -898
Growth Rate: -1522.03%
Updated:February 28 2025
huggingface.co

Total runs: 39
Run Growth: 28
Growth Rate: 71.79%
Updated:May 29 2025
huggingface.co

Total runs: 38
Run Growth: -6
Growth Rate: -15.79%
Updated:August 15 2025
huggingface.co

Total runs: 27
Run Growth: 9
Growth Rate: 33.33%
Updated:November 21 2024
huggingface.co

Total runs: 13
Run Growth: 8
Growth Rate: 61.54%
Updated:July 30 2025
huggingface.co

Total runs: 11
Run Growth: -14
Growth Rate: -127.27%
Updated:November 21 2024
huggingface.co

Total runs: 6
Run Growth: 1
Growth Rate: 16.67%
Updated:August 19 2025
huggingface.co

Total runs: 6
Run Growth: 0
Growth Rate: 0.00%
Updated:November 14 2024
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:December 19 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:December 03 2025