模型权重需单独从 Hugging Face 下载,仓库不含权重;vLLM 和 TensorRT-LLM 加速需按 deployment 目录文档另行安装配置;demo_element.py 的 --input_path 在 README 中为空,需自行指定元素图片路径。

Dolphin
bytedance更新放缓字节跳动开源的文档图像解析模型,用异构锚点提示把 PDF 和图片里的版面、文字、表格一次性解析成结构化内容,适合喂给 RAG 或做文档分析。
The official repo for “Dolphin: Document Image Parsing via Heterogeneous Anchor Prompting”, ACL, 2025.
git clone https://github.com/ByteDance/Dolphin.git && cd Dolphin
pip install -r requirements.txt
huggingface-cli download ByteDance/Dolphin-v2 --local-dir ./hf_modelREADME 未说明显存需求与 GPU 型号;Dolphin-v2 为 3B 参数模型,需自行按模型规模准备显存。
字节开源的多模态文档解析模型,把整页图片或 PDF 转成结构化 JSON 与 Markdown
字节跳动开源的文档图像解析模型,用异构锚点提示把 PDF 和图片里的版面、文字、表格一次性解析成结构化内容,适合喂给 RAG 或做文档分析。
核心能力
- 两阶段先分类版面再按文档类型选择解析策略
- 用异构锚点提示分别处理文本、表格、公式和代码
- 支持整页解析与单元素解析两种粒度
- 生成符合自然阅读顺序的元素序列
- 提供 vLLM 与 TensorRT-LLM 加速推理支持
容易踩的坑
暂无 release 数据(可能没有发版,或尚未同步)。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Dolphin: Document Image Parsing via Heterogeneous Anchor Prompting
Dolphin-v2 is an enhanced universal document parsing model that substantially improves upon the original Dolphin. It seamlessly handles any document type—whether digital-born or photographed—through a document-type-aware two-stage architecture with scalable anchor prompting.
📑 Overview
Document image parsing is challenging due to diverse document types and complexly intertwined elements such as text paragraphs, figures, formulas, tables, and code blocks. Dolphin-v2 addresses these challenges through a document-type-aware two-stage approach:
- 🔍 Stage 1: Document type classification (digital vs. photographed) + layout analysis with reading order prediction
- 🧩 Stage 2: Hybrid parsing strategy - holistic parsing for photographed documents, parallel element-wise parsing for digital documents
Dolphin achieves promising performance across diverse page-level and element-level parsing tasks while ensuring superior efficiency through its lightweight architecture and parallel parsing mechanism.
📅 Changelog
- 🔥 2025.12.12 Released Dolphin-v2 model. Upgraded to 3B parameters with 21-element detection, attribute field extraction, dedicated formula/code parsing, and robust photographed document parsing. (Dolphin-1.5 moved to v1.5 branch)
- 🔥 2025.10.16 Released Dolphin-1.5 model. While maintaining the lightweight 0.3B architecture, this version achieves significant parsing improvements. (Dolphin 1.0 moved to v1.0 branch)
- 🔥 2025.07.10 Released the Fox-Page Benchmark, a manually refined subset of the original Fox dataset. Download via: Baidu Yun | Google Drive.
- 🔥 2025.06.30 Added TensorRT-LLM support for accelerated inference!
- 🔥 2025.06.27 Added vLLM support for accelerated inference!
- 🔥 2025.06.13 Added multi-page PDF document parsing capability.
- 🔥 2025.05.21 Our demo is released at link. Check it out!
- 🔥 2025.05.20 The pretrained model and inference code of Dolphin are released.
- 🔥 2025.05.16 Our paper has been accepted by ACL 2025. Paper link: arXiv.
📈 Performance
🛠️ Installation
-
Clone the repository:
git clone https://github.com/ByteDance/Dolphin.git cd Dolphin -
Install the dependencies:
pip install -r requirements.txt -
Download the pre-trained models of Dolphin-v2:
Visit our Huggingface model card, or download model by:
# Download the model from Hugging Face Hub git lfs install git clone https://huggingface.co/ByteDance/Dolphin-v2 ./hf_model # Or use the Hugging Face CLI pip install huggingface_hub huggingface-cli download ByteDance/Dolphin-v2 --local-dir ./hf_model
⚡ Inference
Dolphin provides two inference frameworks with support for two parsing granularities:
- Page-level Parsing: Parse the entire document page into a structured JSON and Markdown format
- Element-level Parsing: Parse individual document elements (text, table, formula)
📄 Page-level Parsing
# Process a single document image
python demo_page.py --model_path ./hf_model --save_dir ./results \
--input_path ./demo/page_imgs/page_1.png
# Process a single document pdf
python demo_page.py --model_path ./hf_model --save_dir ./results \
--input_path ./demo/page_imgs/page_6.pdf
# Process all documents in a directory
python demo_page.py --model_path ./hf_model --save_dir ./results \
--input_path ./demo/page_imgs
# Process with custom batch size for parallel element decoding
python demo_page.py --model_path ./hf_model --save_dir ./results \
--input_path ./demo/page_imgs \
--max_batch_size 8
🧩 Element-level Parsing
# Process element images (specify element_type: table, formula, text, or code)
python demo_element.py --model_path ./hf_model --save_dir ./results \
--input_path \
--element_type [table|formula|text|code]
🎨 Layout Parsing
# Process a single document image
python demo_layout.py --model_path ./hf_model --save_dir ./results \
--input_path ./demo/page_imgs/page_1.png \
# Process a single PDF document
python demo_layout.py --model_path ./hf_model --save_dir ./results \
--input_path ./demo/page_imgs/page_6.pdf \
# Process all documents in a directory
python demo_layout.py --model_path ./hf_model --save_dir ./results \
--input_path ./demo/page_imgs
🌟 Key Features
- 🔄 Two-stage analyze-then-parse approach based on a single VLM
- 📊 Promising performance on document parsing tasks
- 🔍 Natural reading order element sequence generation
- 🧩 Heterogeneous anchor prompting for different document elements
- ⏱️ Efficient parallel parsing mechanism
- 🤗 Support for Hugging Face Transformers for easier integration
📮 Notice
Call for Bad Cases: If you have encountered any cases where the model performs poorly, we would greatly appreciate it if you could share them in the issue. We are continuously working to optimize and improve the model.
💖 Acknowledgement
We would like to acknowledge the following open-source projects that provided inspiration and reference for this work:
📝 Citation
If you find this code useful for your research, please use the following BibTeX entry.
@article{feng2025dolphin,
title={Dolphin: Document Image Parsing via Heterogeneous Anchor Prompting},
author={Feng, Hao and Wei, Shu and Fei, Xiang and Shi, Wei and Han, Yingdong and Liao, Lei and Lu, Jinghui and Wu, Binghong and Liu, Qi and Lin, Chunhui and others},
journal={arXiv preprint arXiv:2505.14059},
year={2025}
}