/ Модель

Характеристики

Размер весов
8,2 ГБ
Библиотека
monkeyocr
Опубликована
5 июн 2025

MonkeyOCR

Изображение и текст → текст8 профессий

MonkeyOCR разбирает изображения и страницы PDF на китайском и английском языках, распознавая текст и структуру документа и выдавая результат в Markdown.

257скачиваний за 30 дней516лайковвеса обновлены3 мар 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки2

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

  • Delores-Lin/MDPBench

    score

    Результат

    65

    ru 51,7digital 84,3ko 78,9
    Hugging Face Eval Results

    Отчёт автораревизия не подтверждена

  • PaddlePaddle/Real5-OmniDocBench

    score

    Результат

    78,29

    scanning 84,65illumination 83,16screen_photography 80,71
    Hugging Face Eval Results

    Отчёт автораревизия не подтверждена

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

MonkeyOCR — модель для разбора документов, разработанная авторами Zhang Li и соавторами. Она использует парадигму Structure-Recognition-Relation: определяет структуру страницы, распознаёт содержимое и устанавливает отношения между элементами, формируя результат в Markdown. Модель принимает изображения документов и страницы PDF; для обработки PDF и каталогов с файлами в README описаны локальный запуск, API и демонстрационный интерфейс.

MonkeyOCR предназначена для разбора китайских и английских документов. В карточке описаны варианты семейства на 1,2 млрд и 3 млрд параметров; для версии pro-1.2B заявлены более высокая скорость и сопоставимые результаты с вариантом pro-3B. Репозиторий содержит веса в формате safetensors и библиотеку MonkeyOCR. Авторы отмечают ограничения при работе с фотографиями текста, рукописным содержимым, традиционными китайскими и многоязычными текстами. Использование заявлено для академических исследований и некоммерческих целей.

Сценарии применения

  • извлечение текста и структуры из страниц PDF
  • распознавание текста в сканах документов
  • преобразование таблиц и элементов страницы в структурированный Markdown
  • разбор китайских и английских документов
  • пакетная обработка изображений документов

Ограничения

Модель пока ограниченно поддерживает фотографированный текст, рукописный ввод, традиционные китайские и многоязычные тексты. Использование предназначено для академических исследований и некоммерческих целей.

Для каких профессий подходит8

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

arXiv HuggingFace GitHub issues GitHub closed issues License GitHub views

MonkeyOCR: Document Parsing with a Structure-Recognition-Relation Triplet Paradigm Zhang Li, Yuliang Liu, Qiang Liu, Zhiyin Ma, Ziyang Zhang, Shuo Zhang, Zidun Guo, Jiarui Zhang, Xinyu Wang, Xiang Bai arXiv Source_code Model Weight Model Weight Public Courses Demo

Introduction

MonkeyOCR adopts a Structure-Recognition-Relation (SRR) triplet paradigm, which simplifies the multi-tool pipeline of modular approaches while avoiding the inefficiency of using large multimodal models for full-page document processing.

  1. MonkeyOCR-pro-1.2B surpasses MonkeyOCR-3B by 7.4% on Chinese documents.
  2. MonkeyOCR-pro-1.2B delivers approximately a 36% speed improvement over MonkeyOCR-pro-3B, with approximately 1.6% drop in performance.
  3. On olmOCR-Bench, MonkeyOCR-pro-1.2B outperforms Nanonets-OCR-3B by 7.3%.
  4. On OmniDocBench, MonkeyOCR-pro-3B achieves the best overall performance on both English and Chinese documents, outperforming even closed-source and extra-large open-source VLMs such as Gemini 2.0-Flash, Gemini 2.5-Pro, Qwen2.5-VL-72B, GPT-4o, and InternVL3-78B.

See detailed results below.

Comparing MonkeyOCR with closed-source and extra large open-source VLMs.

Inference Speed (Pages/s) on Different GPUs and PDF Page Counts

VLM OCR Speed (Pages/s) on Different GPUs and PDF Page Counts

Supported Hardware

Due to the limited types of GPUs available to us, we may not be able to provide highly accurate hardware specifications. We've tested the model on GPUs such as the 3090, 4090, A6000, H800, A100, and even the 4060 with 8GB of VRAM (suitable for deploying quantized 3B model and 1.2B model). We are very grateful for the feedback and contributions from the open-source community, who have also successfully run the model on 50-series GPUs, H200, L20, V100, 2080 Ti and npu.

News

  • 2025.07.10 🚀 We release MonkeyOCR-pro-1.2B, — a leaner and faster version model that outperforms our previous 3B version in accuracy, speed, and efficiency.
  • 2025.06.12 🚀 The model’s trending on Hugging Face. Thanks for the love!
  • 2025.06.05 🚀 We release MonkeyOCR, an English and Chinese documents parsing model.

Quick Start

Locally Install

1. Install MonkeyOCR

See the installation guide to set up your environment.

2. Download Model Weights

Download our model from Huggingface.

pip install huggingface_hub

python tools/download_model.py -n MonkeyOCR-pro-3B  # or MonkeyOCR

You can also download our model from ModelScope.

pip install modelscope

python tools/download_model.py -t modelscope -n MonkeyOCR-pro-3B  # or MonkeyOCR

3. Inference

You can parse a file or a directory containing PDFs or images using the following commands:

# Replace input_path with the path to a PDF or image or directory

# End-to-end parsing
python parse.py input_path

# Parse files in a dir with specific group page num
python parse.py input_path -g 20

# Single-task recognition (outputs markdown only)
python parse.py input_path -t text/formula/table

# Parse PDFs in input_path and split results by pages
python parse.py input_path -s

# Specify output directory and model config file
python parse.py input_path -o ./output -c config.yaml
# Single file processing
python parse.py input.pdf                           # Parse single PDF file
python parse.py input.pdf -o ./output               # Parse with custom output dir
python parse.py input.pdf -s                        # Parse PDF with page splitting
python parse.py image.jpg                           # Parse single image file

# Single task recognition
python parse.py image.jpg -t text                   # Text recognition from image
python parse.py image.jpg -t formula                # Formula recognition from image
python parse.py image.jpg -t table                  # Table recognition from image
python parse.py document.pdf -t text                # Text recognition from all PDF pages

# Folder processing (all files individually)
python parse.py /path/to/folder                     # Parse all files in folder
python parse.py /path/to/folder -s                  # Parse with page splitting
python parse.py /path/to/folder -t text             # Single task recognition for all files

# Multi-file grouping (batch processing by page count)
python parse.py /path/to/folder -g 5                # Group files with max 5 total pages
python parse.py /path/to/folder -g 10 -s            # Group files with page splitting
python parse.py /path/to/folder -g 8 -t text        # Group files for single task recognition

# Advanced configurations
python parse.py input.pdf -c model_configs.yaml     # Custom model configuration
python parse.py /path/to/folder -g 15 -s -o ./out   # Group files, split pages, custom output
python parse.py input.pdf --pred-abandon            # Enable predicting abandon elements
  python parse.py /path/to/folder -g 10 -m            # Group files and merge text blocks in output

MonkeyOCR mainly generates three types of output files:

  1. Processed Markdown File (your.md): The final parsed document content in markdown format, containing text, formulas, tables, and other structured elements.
  2. Layout Results (your_layout.pdf): The layout results drawed on origin PDF.
  3. Intermediate Block Results (your_middle.json): A JSON file containing detailed information about all detected blocks, including:
    • Block coordinates and positions
    • Block content and type information
    • Relationship information between blocks

These files provide both the final formatted output and detailed intermediate results for further analysis or processing.

4. Gradio Demo

python demo/demo_gradio.py

Once the demo is running, you can access it at http://localhost:7860.

5. Fast API

You can start the MonkeyOCR FastAPI service with the following command:

uvicorn api.main:app --port 8000

Once the API service is running, you can access the API documentation at http://localhost:8000/docs to explore available endpoints.

[!TIP] To improve API concurrency performance, consider configuring the inference backend as lmdeploy_queue or vllm_queue.

Docker Deployment

  1. Navigate to the docker directory:

    cd docker
    
  2. Prerequisite: Ensure NVIDIA GPU support is available in Docker (via nvidia-docker2). If GPU support is not enabled, run the following to set up the environment:

    bash env.sh
    
  3. Build the Docker image:

    docker compose build monkeyocr
    

[!IMPORTANT]

If your GPU is from the 20/30/40-series, V100, L20/L40 or similar, please build the patched Docker image for LMDeploy compatibility:

docker compose build monkeyocr-fix

Otherwise, you may encounter the following error: triton.runtime.errors.OutOfResources: out of resource: shared memory

  1. Run the container with the Gradio demo (accessible on port 7860):

    docker compose up monkeyocr-demo
    

    Alternatively, start an interactive development environment:

    docker compose run --rm monkeyocr-dev
    
  2. Run the FastAPI service (accessible on port 7861):

    docker compose up monkeyocr-api
    

    Once the API service is running, you can access the API documentation at http://localhost:7861/docs to explore available endpoints.

Windows Support

See the windows support guide for details.

Quantization

This model can be quantized using AWQ. Follow the instructions in the quantization guide.

Benchmark Results

Here are the evaluation results of our model on OmniDocBench. MonkeyOCR-3B uses DocLayoutYOLO as the structure detection model, while MonkeyOCR-3B* uses our trained structure detection model with improved Chinese performance.

1. The end-to-end evaluation results of different tasks.

2. The end-to-end text recognition performance across 9 PDF page types.

3. The evaluation results of olmOCR-bench.

Visualization Demo

Get a Quick Hands-On Experience with Our Demo: http://vlrlabmonkey.xyz:7685 (The latest model is available for selection)

Our demo is simple and easy to use:

  1. Upload a PDF or image.
  2. Click “Parse (解析)” to let the model perform structure detection, content recognition, and relationship prediction on the input document. The final output will be a markdown-formatted version of the document.
  3. Select a prompt and click “Test by prompt” to let the model perform content recognition on the image based on the selected prompt.

Example for formula document

Example for table document

Example for newspaper

Example for financial report

Citing MonkeyOCR

If you wish to refer to the baseline results published here, please use the following BibTeX entries:

@misc{li2025monkeyocrdocumentparsingstructurerecognitionrelation,
      title={MonkeyOCR: Document Parsing with a Structure-Recognition-Relation Triplet Paradigm}, 
      author={Zhang Li and Yuliang Liu and Qiang Liu and Zhiyin Ma and Ziyang Zhang and Shuo Zhang and Zidun Guo and Jiarui Zhang and Xinyu Wang and Xiang Bai},
      year={2025},
      eprint={2506.05218},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2506.05218}, 
}

Acknowledgments

We would like to thank MinerU, DocLayout-YOLO, PyMuPDF, layoutreader, Qwen2.5-VL, LMDeploy, PP-StructureV3, PP-DocLayout_plus-L, and InternVL3 for providing base code and models, as well as their contributions to this field. We also thank M6Doc, DocLayNet, CDLA, D4LA, DocGenome, PubTabNet, and UniMER-1M for providing valuable datasets. We also thank everyone who contributed to this open-source effort.

Limitation

Currently, MonkeyOCR do not yet fully support for photographed text, handwritten content, Traditional Chinese characters, or multilingual text. We plan to consider adding support for these features in future public releases. Additionally, our model is deployed on a single GPU, so if too many users upload files at the same time, issues like “This application is currently busy” may occur. The processing time shown on the demo page does not reflect computation time alone—it also includes result uploading and other overhead. During periods of high traffic, this time may be longer. The inference speeds of MonkeyOCR, MinerU, and Qwen2.5 VL-7B were measured on an H800 GPU.

Copyright

Please don’t hesitate to share your valuable feedback — it’s a key motivation that drives us to continuously improve our framework. Note: Our model is intended for academic research and non-commercial use only. If you are interested in faster (smaller) or stronger one, please contact us at xbai@hust.edu.cn or ylliu@hust.edu.cn.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · monkeyocr

Нельзя запустить

В репозитории нет config.json: не понять архитектуру модели.

Ревизия весов
eac54d4

0 моделей