From 2156a11d0f1b78bbea0240edeac7ecdaaea05cee Mon Sep 17 00:00:00 2001
From: wehub-resource-sync
- 📥 Model Download |
- 📄 Paper Link |
- 📄 Arxiv Paper Link |
+ 📥 模型下载 |
+ 📄 论文链接 |
+ 📄 Arxiv 论文链接 |
- DeepSeek-OCR: Contexts Optical Compression
+ DeepSeek-OCR:上下文光学压缩(Contexts Optical Compression)
-Explore the boundaries of visual-text compression. +探索视觉-文本压缩的边界。
-## Release -- [2026/01/27]🚀🚀🚀🚀🚀🚀 We present [DeepSeek-OCR2](https://github.com/deepseek-ai/DeepSeek-OCR-2) -- [2025/10/23]🚀🚀🚀 DeepSeek-OCR is now officially supported in upstream [vLLM](https://docs.vllm.ai/projects/recipes/en/latest/DeepSeek/DeepSeek-OCR.html#installing-vllm). Thanks to the [vLLM](https://github.com/vllm-project/vllm) team for their help. -- [2025/10/20]🚀🚀🚀 We release DeepSeek-OCR, a model to investigate the role of vision encoders from an LLM-centric viewpoint. +## 发布 +- [2026/01/27]🚀🚀🚀🚀🚀🚀 我们发布 [DeepSeek-OCR2](https://github.com/deepseek-ai/DeepSeek-OCR-2) +- [2025/10/23]🚀🚀🚀 DeepSeek-OCR 现已在上游 [vLLM](https://docs.vllm.ai/projects/recipes/en/latest/DeepSeek/DeepSeek-OCR.html#installing-vllm). 中获得官方支持。感谢 [vLLM](https://github.com/vllm-project/vllm) 团队的帮助。 +- [2025/10/20]🚀🚀🚀 我们发布 DeepSeek-OCR,这是一个从以 LLM 为中心的视角研究视觉编码器作用的模型。 -## Contents -- [Install](#install) -- [vLLM Inference](#vllm-inference) -- [Transformers Inference](#transformers-inference) +## 目录 +- [安装](#install) +- [vLLM 推理](#vllm-inference) +- [Transformers 推理](#transformers-inference) -## Install ->Our environment is cuda11.8+torch2.6.0. -1. Clone this repository and navigate to the DeepSeek-OCR folder +## 安装 +>我们的环境为 cuda11.8+torch2.6.0。 +1. 克隆本仓库并进入 DeepSeek-OCR 文件夹 ```bash git clone https://github.com/deepseek-ai/DeepSeek-OCR.git ``` @@ -76,37 +82,37 @@ git clone https://github.com/deepseek-ai/DeepSeek-OCR.git conda create -n deepseek-ocr python=3.12.9 -y conda activate deepseek-ocr ``` -3. Packages +3. 依赖包 -- download the vllm-0.8.5 [whl](https://github.com/vllm-project/vllm/releases/tag/v0.8.5) +- 下载 vllm-0.8.5 [whl](https://github.com/vllm-project/vllm/releases/tag/v0.8.5) ```Shell pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 --index-url https://download.pytorch.org/whl/cu118 pip install vllm-0.8.5+cu118-cp38-abi3-manylinux1_x86_64.whl pip install -r requirements.txt pip install flash-attn==2.7.3 --no-build-isolation ``` -**Note:** if you want vLLM and transformers codes to run in the same environment, you don't need to worry about this installation error like: vllm 0.8.5+cu118 requires transformers>=4.51.1 +**注意:** 若你希望 vLLM 与 Transformers 代码在同一环境中运行,则无需担心如下安装错误:vllm 0.8.5+cu118 requires transformers>=4.51.1 -## vLLM-Inference +## vLLM 推理 - VLLM: ->**Note:** change the INPUT_PATH/OUTPUT_PATH and other settings in the DeepSeek-OCR-master/DeepSeek-OCR-vllm/config.py +>**注意:** 请在 DeepSeek-OCR-master/DeepSeek-OCR-vllm/config.py 中修改 INPUT_PATH/OUTPUT_PATH 及其他设置 ```Shell cd DeepSeek-OCR-master/DeepSeek-OCR-vllm ``` -1. image: streaming output +1. 图像:流式输出 ```Shell python run_dpsk_ocr_image.py ``` -2. pdf: concurrency ~2500tokens/s(an A100-40G) +2. PDF:并发约 2500 tokens/s(A100-40G) ```Shell python run_dpsk_ocr_pdf.py ``` -3. batch eval for benchmarks +3. 基准测试批量评估 ```Shell python run_dpsk_ocr_eval_batch.py ``` -**[2025/10/23] The version of upstream [vLLM](https://docs.vllm.ai/projects/recipes/en/latest/DeepSeek/DeepSeek-OCR.html#installing-vllm):** +**[2025/10/23] 上游 [vLLM](https://docs.vllm.ai/projects/recipes/en/latest/DeepSeek/DeepSeek-OCR.html#installing-vllm):** ```shell uv venv @@ -162,7 +168,7 @@ model_outputs = llm.generate(model_input, sampling_param) for output in model_outputs: print(output.outputs[0].text) ``` -## Transformers-Inference +## Transformers 推理 - Transformers ```python from transformers import AutoModel, AutoTokenizer @@ -182,22 +188,22 @@ output_path = 'your/output/dir' res = model.infer(tokenizer, prompt=prompt, image_file=image_file, output_path = output_path, base_size = 1024, image_size = 640, crop_mode=True, save_results = True, test_compress = True) ``` -or you can +或者你可以 ```Shell cd DeepSeek-OCR-master/DeepSeek-OCR-hf python run_dpsk_ocr.py ``` -## Support-Modes -The current open-source model supports the following modes: -- Native resolution: +## 支持模式 +当前开源模型支持以下模式: +- 原生分辨率: - Tiny: 512×512 (64 vision tokens)✅ - Small: 640×640 (100 vision tokens)✅ - Base: 1024×1024 (256 vision tokens)✅ - Large: 1280×1280 (400 vision tokens)✅ -- Dynamic resolution +- 动态分辨率 - Gundam: n×640×640 + 1×1024×1024 ✅ -## Prompts examples +## 提示词示例 ```python # document:![]() |
@@ -222,13 +228,13 @@ The current open-source model supports the following modes: