Back to AI is open source
DeepSeek-OCR 2 Released: Visual Causal Flow Makes Document and Diagram Recognition More "Human-Like"

DeepSeek-OCR 2 Released: Visual Causal Flow Makes Document and Diagram Recognition More "Human-Like"

AI is open source Admin 198 views

1. Abstract

DeepSeek-OCR 2 is an upgrade of DeepSeek's open-source OCR/document understanding model, with the theme of "DeepSeek-OCR 2: Visual Causal Flow", emphasizing a more human-friendly visual coding method and providing stronger structured extraction and understanding capabilities for complex layouts (documents, charts, mixed pages, etc.). The official repository and model card provide two inference paths, Transformers and vLLM, and provide prompt templates such as "convert documents to Markdown", "image OCR", and "target positioning".

2. Core features

  1. Visual Causal Flow direction: officially described as a more "humanized" visual coding; Some interpretations will summarize this as a visual token organization that is more in line with semantic/typography logic (specific algorithm details are recommended to read the PDF of the paper provided with the repository).
  2. Dynamic resolution and token budget: Dynamic resolution is supported, and the default configuration example is a combination of multiple blocks of 768×768 + 1 block of 1024×1024, corresponding to a fixed visual token budget (the official example is about 256 tokens), which is convenient for making trade-offs between speed, video memory and accuracy.
  3. Structured output for documents: The built-in prompt example supports "Convert the document to markdown", which is suitable for converting PDF/image documents into editable text and lightweight structure.
  4. Positioning and general understanding: The prompt example contains rec (locating a reference object) and a general description, which means that it is not only "word reading", but can also be used for understanding and retrieval in mixed graphics and text scenarios.

3. Installation

  1. Environment suggestions: The official test environment is CUDA 11.8 + PyTorch 2.6.0, Python 3.12.9.

2. Transformer inference: Load deepseek-ai/DeepSeek-OCR-2 directly from Hugging Face, and recommend enabling FlashAttention (example is flash-attn==2.7.3) with bfloat16 inference.

  1. vLLM inference: The repository provides vLLM-related instructions and scripts, including image streaming output, PDF concurrent processing, and benchmark batch evaluation scripts. Parameters such as input/output paths need to be modified by configuration file.

4. Typical use cases

  1. Document to Markdown: Scanned copies, papers, manuals and other pictures/pages, one-click export of Markdown for secondary editing and retrieval.
  2. Complex Layout OCR: For scenarios where traditional OCR is prone to disorder, such as tables, mixed graphics and text, and flowchart annotations, try to use "with layout/grounding" prompts to obtain a more stable structure.
  3. Diagram and illustration analysis: Separate analysis of figures in documents, suitable for knowledge base construction and report automation.
  4. Target positioning and citation: Use positioning prompts to find elements (such as a label, button, or area) in the diagram for document review, data annotation, and automatic quality inspection.

5. Ecology and competing products

  1. Ecology: Model weights are published on Hugging Face, and the repository provides inference scripts and PDF concurrent processing entrances, which is convenient for access to offline pipelines or service-oriented deployment.
  2. Competing products/references: Projects such as Vary, GOT-OCR2.0, MinerU, and PaddleOCR appear in the official acknowledgment and benchmarking links, which can be used as comparison objects in the dimensions of "speed, layout restoration, open source controllability, and deployment cost".
  3. Selection suggestions: If you pay attention to "Document Structured Output (Markdown) + Concurrent Batch Processing (PDF) + Unified Multimodal Prompt", the project entrance of DeepSeek-OCR 2 is closer to the assembly line. If you prefer traditional OCR engines and rule post-processing, ecosystems such as PaddleOCR/MinerU are more mature.

6. Limitations and precautions

  1. The details of the paper need to be checked: the database provides a PDF of the paper, but the model card/README is more restrained in describing the details of the algorithm. It involves key mechanisms such as "visual causal flow/dynamic organization", and it is recommended to refer to the paper and code implementation.
  2. Video memory and throughput: Dynamic resolution and visual token budget will directly affect video memory usage and speed, so it is recommended to use small batch verification before concurrency.
  3. Output quality dependent prompts: For the same document, "Free OCR", "Markdown Conversion with Grounding", and "figure parsing" will get results of different granularity, and it is recommended to solidify the prompt template and evaluation set for the business.
  4. Complex documents still need to be proofread: for mathematical formulas, extreme typesetting, and low-definition scans, it is still recommended to manually check or introduce a secondary verification process.

7. Project address

https://github.com/deepseek-ai/DeepSeek-OCR-2

8. Frequently asked questions

Q: What are the core keywords of DeepSeek-OCR 2? What exactly does Visual Causal Flow mean?

A: Officially, it is described as a more "human" direction of visual coding; For more specific mechanisms, the repository paper PDF and code implementation shall prevail.

Q: How does DeepSeek-OCR 2 convert image documents to Markdown?

A: Use the prompt example <image>\n<|grounding|>Convert the document to markdown. and call model.infer(...) as the example outputs to the specified directory.

Q: Does DeepSeek-OCR 2 support batch running PDFs?

A: Yes. The repository gives the vLLM a PDF concurrency script entry and prompts to modify parameters such as input/output paths in the configuration file.

Q: What is the open-source license for DeepSeek-OCR 2? Can it be commercialized?

A: The repository and model card are marked as Apache-2.0; It is still recommended to check the license list once based on your distribution method and dependencies.

Q: How does dynamic resolution and visual token budget affect performance?

A: Higher resolution or more chunking is usually more conducive to complex layouts, but it is also more memory-intensive/slower; It is recommended to do a "speed-precision" curve test around your document type before finalizing.

DeepSeek open-source DeepSeek-OCR 2 upgrade: Visual Causal Flow enhances document understanding DeepSeek-OCR 2 released: Structured extraction capabilities for complex layouts have been greatly enhanced DeepSeek-OCR 2 Explained: Why Visual Causal Flow is More Like Human Visual Coding DeepSeek-OCR 2 supports document to Markdown: PDF images can be edited with one click DeepSeek-OCR 2 launches dynamic resolution: how to balance speed and memory accuracy DeepSeek-OCR 2 gives an example of a budget of 256 visual tokens: what is the cost of increased throughput? DeepSeek-OCR 2 provides two inference paths: Transformers and vLLMs: more flexible deployment DeepSeek-OCR 2 vLLM scripts support concurrent PDF processing: Pipeline batch OCR is more hassle-free DeepSeek-OCR 2 adds the positioning prompt rec: not only read words but also find targets DeepSeek-OCR 2 adapts charts and shuffle pages: The pain points of traditional OCR out-of-order are targeted DeepSeek-OCR 2 model card announcement prompt template: grounding makes the structure more stable DeepSeek-OCR 2 Engineering Highlights: Complete image streaming output and batch evaluation scripts DeepSeek-OCR 2 installation environment exposure: CUDA 11.8 + PyTorch 2.6.0 is the recommended combination DeepSeek-OCR 2 recommends enabling FlashAttention: Speed up inference, but be careful when compatible DeepSeek-OCR 2 uses bfloat16 to reason: the video memory pressure drops, but how effective DeepSeek-OCR 2 Converts Scans to Markdown: How Knowledge Base Construction Efficiency Improves DeepSeek-OCR 2 Complex Table OCR: Can Structured Output Reduce Post-Processing? DeepSeek-OCR 2 Flowchart and Annotation Analysis: Document understanding moves from text to layout DeepSeek-OCR 2 figure separate parsing: a new entry point for reporting automation DeepSeek-OCR 2 targeting and citation: document review and quality inspection are more controllable DeepSeek-OCR 2 Open Source Apache-2.0: Commercial compliance still requires a license list DeepSeek-OCR 2 paper PDF is provided with the repository: algorithm details are subject to the code Controversy of the DeepSeek-OCR 2 algorithm: README restraint description and reproducible detail gaps DeepSeek-OCR 2 dynamic dicing 768x768+1024x1024: Will the wrong configuration overturn? DeepSeek-OCR 2 prompt determines output quality: What is the difference between Free OCR and grounding? DeepSeek-OCR 2 output still needs to be proofread: extreme formula typesetting low-definition scanning is a difficulty DeepSeek-OCR 2 Throughput Evaluation Guide: Uploading PDF in small batches is more stable for concurrency DeepSeek-OCR 2 is suitable for offline pipelines: structured Markdown + batch processing integration Key points of DeepSeek-OCR 2 service-based deployment: Don't ignore path configuration and permission isolation DeepSeek-OCR 2 vs. PaddleOCR: Who is stronger in rule engine maturity and structuring ability? DeepSeek-OCR 2 vs. MinerU: How to Choose Open Source Controllable and Deployment Costs DeepSeek-OCR 2 Benchmarks GOT-OCR2.0 and Vary: Where is the difference in the layout restoration route? DeepSeek-OCR 2 Ecosystem Inventory: Hugging Face Weight + GitHub Script Quickly Implemented DeepSeek-OCR 2 prompt example public: How to use Convert the document to markdown DeepSeek-OCR 2 Loading deepseek-ai/DeepSeek-OCR-2 with Transformers: Easier to get started DeepSeek-OCR 2 vLLM Concurrent PDF: How to Change the Input and Output Path of the Configuration File DeepSeek-OCR 2 Image Streaming Output: What Real-Time OCR Means for Interactive Products DeepSeek-OCR 2 Structured Extraction Targeting Mixing: Document RAG data cleaning is lighter DeepSeek-OCR 2 positioning capability rec: more efficient data annotation and automatic quality inspection DeepSeek-OCR 2 Visual Token Budget Controllable: How to Draw the Cost Curve DeepSeek-OCR 2 Humanizes Visual Coding: Why Understanding Complex Typography Matters DeepSeek-OCR 2 turns OCR into document understanding: from recognition to structured upgrade points DeepSeek-OCR 2 Practice Recommendation: Cure the prompt template and evaluation set to avoid drift DeepSeek-OCR 2 Risk Warning: Concurrent failure retries should be combined with the log system first DeepSeek-OCR 2 Deployment Cost: How to Estimate Memory Bandwidth and Throughput List of applicable scenarios for DeepSeek-OCR 2: Convert paper specifications and scanned copies to editable text DeepSeek-OCR 2 Chart Interpretation Capability: A key part of knowledge base and report generation Behind the DeepSeek-OCR 2 open source update: Structured output of documents becomes a new battlefield Get started with DeepSeek-OCR 2: Three prompts cover OCR Markdown and positioning DeepSeek-OCR 2 Full Analysis: Visual Causal Flow Dynamic Resolution Engineering Script and Limitations

Recommended Tools

More