docs: make Chinese README the default
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
<!-- WEHUB_ZH_README -->
|
||||
> [!NOTE]
|
||||
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
|
||||
> [English](./README.en.md) · [原始项目](https://github.com/deepseek-ai/DeepSeek-OCR) · [上游 README](https://github.com/deepseek-ai/DeepSeek-OCR/blob/HEAD/README.md)
|
||||
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
|
||||
|
||||
<!-- markdownlint-disable first-line-h1 -->
|
||||
<!-- markdownlint-disable html -->
|
||||
<!-- markdownlint-disable no-duplicate-header -->
|
||||
@@ -33,14 +39,14 @@
|
||||
|
||||
|
||||
<p align="center">
|
||||
<a href="https://huggingface.co/deepseek-ai/DeepSeek-OCR"><b>📥 Model Download</b></a> |
|
||||
<a href="https://github.com/deepseek-ai/DeepSeek-OCR/blob/main/DeepSeek_OCR_paper.pdf"><b>📄 Paper Link</b></a> |
|
||||
<a href="https://arxiv.org/abs/2510.18234"><b>📄 Arxiv Paper Link</b></a> |
|
||||
<a href="https://huggingface.co/deepseek-ai/DeepSeek-OCR"><b>📥 模型下载</b></a> |
|
||||
<a href="https://github.com/deepseek-ai/DeepSeek-OCR/blob/main/DeepSeek_OCR_paper.pdf"><b>📄 论文链接</b></a> |
|
||||
<a href="https://arxiv.org/abs/2510.18234"><b>📄 Arxiv 论文链接</b></a> |
|
||||
</p>
|
||||
|
||||
<h2>
|
||||
<p align="center">
|
||||
<a href="">DeepSeek-OCR: Contexts Optical Compression</a>
|
||||
<a href="">DeepSeek-OCR:上下文光学压缩(Contexts Optical Compression)</a>
|
||||
</p>
|
||||
</h2>
|
||||
|
||||
@@ -48,26 +54,26 @@
|
||||
<img src="assets/fig1.png" style="width: 1000px" align=center>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="">Explore the boundaries of visual-text compression.</a>
|
||||
<a href="">探索视觉-文本压缩的边界。</a>
|
||||
</p>
|
||||
|
||||
## 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: <image>\n<|grounding|>Convert the document to markdown.
|
||||
# other image: <image>\n<|grounding|>OCR this image.
|
||||
@@ -209,7 +215,7 @@ The current open-source model supports the following modes:
|
||||
```
|
||||
|
||||
|
||||
## Visualizations
|
||||
## 可视化
|
||||
<table>
|
||||
<tr>
|
||||
<td><img src="assets/show1.jpg" style="width: 500px"></td>
|
||||
@@ -222,13 +228,13 @@ The current open-source model supports the following modes:
|
||||
</table>
|
||||
|
||||
|
||||
## Acknowledgement
|
||||
## 致谢
|
||||
|
||||
We would like to thank [Vary](https://github.com/Ucas-HaoranWei/Vary/), [GOT-OCR2.0](https://github.com/Ucas-HaoranWei/GOT-OCR2.0/), [MinerU](https://github.com/opendatalab/MinerU), [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR), [OneChart](https://github.com/LingyvKong/OneChart), [Slow Perception](https://github.com/Ucas-HaoranWei/Slow-Perception) for their valuable models and ideas.
|
||||
我们感谢 [Vary](https://github.com/Ucas-HaoranWei/Vary/), [GOT-OCR2.0](https://github.com/Ucas-HaoranWei/GOT-OCR2.0/), [MinerU](https://github.com/opendatalab/MinerU), [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR), [OneChart](https://github.com/LingyvKong/OneChart), [Slow Perception](https://github.com/Ucas-HaoranWei/Slow-Perception) 提供的宝贵模型与思路。
|
||||
|
||||
We also appreciate the benchmarks: [Fox](https://github.com/ucaslcl/Fox), [OminiDocBench](https://github.com/opendatalab/OmniDocBench).
|
||||
我们也感谢以下基准测试:[Fox](https://github.com/ucaslcl/Fox), [OminiDocBench](https://github.com/opendatalab/OmniDocBench).
|
||||
|
||||
## Citation
|
||||
## 引用
|
||||
|
||||
```bibtex
|
||||
@article{wei2025deepseek,
|
||||
@@ -237,3 +243,4 @@ We also appreciate the benchmarks: [Fox](https://github.com/ucaslcl/Fox), [Omini
|
||||
journal={arXiv preprint arXiv:2510.18234},
|
||||
year={2025}
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user