Apache License 2.0

项目介绍

PRITHIVSAKTHIUR/DeepSeek-OCR-2-Unlimited-OCR 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 Apache License 2.0 许可证,目前获得 15 个 Star、3 次 Fork。

仓库全名
PRITHIVSAKTHIUR/DeepSeek-OCR-2-Unlimited-OCR
开源许可证
Apache License 2.0
Star 数
15
Fork 数
3

README 摘要

DeepSeek-OCR-2-Unlimited-OCR DeepSeek-OCR-2-Unlimited-OCR is an advanced, experimental visual document processing and open-ended text localization dashboard. This application establishes a unified interface that allows users to swap between two premier vision-language document models: deepseek-ai/DeepSeek-OCR-2 and baidu/Unlimited-OCR. The core system handles document-to-markdown conversion, mathematical layout…

完整内容见 GitHub 原始 README 或本页 。

常见问题

DeepSeek-OCR-2-Unlimited-OCR 用什么语言开发?

主要使用 Python 编写,采用 Apache License 2.0 许可证,目前有 15 个 Star。

DeepSeek-OCR-2-Unlimited-OCR 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 DeepSeek-OCR-2-Unlimited-OCR 的源码?

可以直接克隆仓库:git clone https://github.com/PRITHIVSAKTHIUR/DeepSeek-OCR-2-Unlimited-OCR.git,默认分支为 main;安装与运行步骤见仓库 README。

DeepSeek-OCR-2-Unlimited-OCR 最近还在维护吗?

仓库最近一次更新为 6月25日,当前没有未关闭的 Issue;Star 数为 15,可作为社区活跃度的参考。

关于

DeepSeek-OCR-2-Unlimited-OCR is an advanced, experimental visual document processing and open-ended text localization dashboard. This application establishes a unified interface that allows users to swap between two premier vision-language document models: deepseek-ai/DeepSeek-OCR-2 and baidu/Unlimited-OCR.

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

语言占比

Jupyter Notebook
Python

README

DeepSeek-OCR-2-Unlimited-OCR

DeepSeek-OCR-2-Unlimited-OCR is an advanced, experimental visual document processing and open-ended text localization dashboard. This application establishes a unified interface that allows users to swap between two premier vision-language document models: deepseek-ai/DeepSeek-OCR-2 and baidu/Unlimited-OCR.

The core system handles document-to-markdown conversion, mathematical layout rendering, dense object localization, and raw textual extraction. Crucially, the platform leverages structured parsing loops to capture coordinate boundaries (<|ref|> and <|det|>), dynamically painting multi-colored bounding boxes directly on the document while segmenting and extracting sub-figure graphics into a standalone output gallery. Fully optimized via specialized Flash Attention 2 layers, the app operates as a localized, high-speed vision suite tailored for complex multi-lingual document intelligence.

example 1 example 2

Key Features

  • Dual-Backbone Document Intelligence: Seamlessly switch between the highly structural DeepSeek-OCR-2 architecture (optimized with Flash Attention 2) and the long-context Unlimited-OCR model capable of matching up to 32,768 tokens.
  • Granular Visual Grounding: Programmatically maps detected text lines, headings, and embedded graphics into precise spatial bounding boxes.
  • Sub-Figure Graphic Cropping: Automatically captures figure bounding boxes, crops target graphics from the primary source image canvas, and populates them into an interactive Gradio thumbnail gallery.
  • Adaptive Aspect Resolution Profiles: Offers multi-stage processing configs (e.g., Default, Quality, Fast, No Crop, Gundam) to scale internal dimensions up to $1536^2$ while handling aspect ratios smoothly.
  • Bespoke Dodger Blue UI Architecture: Enclosed inside a tailored, web-responsive blueprint featuring a grid backdrop, explicit multiline code blocks, dedicated Markdown layout previews, and full layout state synchronization.

Repository Structure

├── demo-notebook/
│   └── DeepSeek_OCR_2_Demo.ipynb
├── examples/
│   ├── 1.jpg
│   ├── 2.jpg
│   └── 3.jpg
├── deepseek_ocr_2_unlimited_ocr.py
├── LICENSE.txt
├── pre-requirements.txt
├── README.md
└── requirements.txt

Installation and Requirements

To initialize the DeepSeek-OCR-2-Unlimited-OCR suite locally, configure a Python 3.10 environment with the exact deep learning stack specified below. A local system containing a dedicated CUDA cu12-enabled GPU is required.

1. Upgrade Package Manager Update your system package installer before fetching modern pre-compiled wheel distributions:

pip install pip>=26.0.0

2. Install Core Stack Install the explicit PyTorch 2.8.0 and CUDA cu12 dependencies, alongside specialized Flash Attention 2 binaries. Place these inside a requirements.txt file and run:

pip install -r requirements.txt

Core Requirements List (requirements.txt)
flash-attn @ https://huggingface.co/strangertoolshf/flash_attention_2_wheelhouse/resolve/main/wheelhouse-flash_attn-2.8.3/linux_x86_64/torch2.8/cu12/abiFALSE/cp310/flash_attn-2.8.3+cu12torch2.8cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
git+https://github.com/huggingface/[email protected]
git+https://github.com/huggingface/accelerate.git
git+https://github.com/huggingface/diffusers.git
git+https://github.com/huggingface/peft.git
tokenizers==0.20.3
huggingface_hub
sentencepiece
torch==2.8.0
torchvision
matplotlib
accelerate
easydict
addict
gradio==6.9.0
einops
spaces
numpy


Usage

Once your compiled infrastructure wheels and underlying tokenizer layers have successfully loaded, launch the script locally:

python deepseek_ocr_2_unlimited_ocr.py

Upon initialization, the system pre-loads the default model weights into device VRAM. Open your web browser to the local network link (typically http://127.0.0.1:7860/).

  1. Upload Asset: Drop an image document, textbook page, invoice, or diagram into the Upload Image zone (supports direct clipboard pasting).
  2. Configure Pipeline: Select your target Model backbone, adjust the Resolution profile, and pick an operational task:
  • Markdown: Converts layout formats directly to standard Markdown, embedding tables, formulas, and structural text.
  • OCR Image / Free OCR: Extracts pure textual elements line by line.
  • Locate: Enter custom words inside the prompt line to programmatically locate text positions.
  1. Execute: Click Perform OCR. Each model is lazy-loaded on its first selection and cached subsequently on the GPU. Explore the generated data across the dedicated Text, Markdown Preview, Boxes, Cropped Images, and Raw Text tab layouts.

License and Source

评论

暂无评论