
DeepSeek-OCR
https://github.com/deepseek-ai/deepseek-ocr- Category
- AI Tools
- Rank
- No. 501Tools index
- Pricing
- Open Source
- Type
- TOOL
- Builder
- deepseek-ai
- GitHub
- 23.9k stars
- Date
About
DeepSeek's vision-language model for OCR via "contexts optical compression" — turning long-context text problems into image understanding.
What it does
DeepSeek-OCR reads images or PDF pages through a vision-language model, then produces text, Markdown, layout labels, coordinates, and extracted document figures. Prompts select tasks such as plain OCR, layout-aware conversion, figure parsing, image description, or locating referenced content.
Why it's ranked here
The tool offers unusually broad document handling in one model workflow: single images, concurrent PDF pages, benchmark batches, layout reconstruction, and several resolution modes. The implementation is useful but operationally demanding, with CUDA-specific setup, version friction, manual configuration, and trusted remote model code.
What's good
It supports both Transformers and vLLM inference, including streamed image output and concurrent PDF processing. Dynamic tiling adapts large or wide pages, while fixed modes expose clear vision-token budgets. Layout-aware output can preserve Markdown structure, identify regions, crop figures, and render annotated pages.
Tradeoffs
Setup targets CUDA 11.8, pinned PyTorch packages, FlashAttention, and a specific Linux vLLM wheel. The documented Transformers version conflicts with vLLM's stated requirement. Input and output locations require source configuration, GPU selection is fixed in scripts, and coordinate parsing evaluates model-produced text directly.
How to use it well
Use it for GPU-backed document ingestion where Markdown, page structure, figure extraction, or batch PDF processing matters. Start with the Transformers route for a direct image workflow, then adopt vLLM for streaming or concurrency. The documented workflow does not cover a hosted service interface or managed deployment.
Technical notes+
requirements.txt pins transformers==4.46.3 and tokenizers==0.20.3; the README separately notes vLLM 0.8.5 requires Transformers 4.51.1 or newer. DeepSeek-OCR-master/DeepSeek-OCR-hf/run_dpsk_ocr.py loads Hugging Face model code with trust_remote_code=True, FlashAttention 2, CUDA, and bfloat16. DeepSeek-OCR-master/DeepSeek-OCR-vllm/config.py centralizes resolution, crop, concurrency, worker, prompt, and path settings. DeepSeek-OCR-master/DeepSeek-OCR-vllm/process/image_process.py selects aspect-ratio tiles between configured crop limits. DeepSeek-OCR-master/DeepSeek-OCR-vllm/run_dpsk_ocr_pdf.py rasterizes PDF pages, batches inference, writes Markdown-like output, extracts figures, and produces a layout PDF. Both PDF and image runners use eval when decoding model-generated coordinate or geometry text.
Observed
- Primary language
- Python
- Install surface
- Conda environment plus pip-installed PyTorch, vLLM, requirements, and FlashAttention
- Model distribution
- Weights are downloaded from Hugging Face
- Inference interfaces
- Transformers library workflow and vLLM image, PDF, and batch scripts
- Document inputs
- JPEG, PNG, and PDF workflows are documented
- Platform target
- Documented environment uses CUDA 11.8 and PyTorch 2.6.0 on x86-64 Linux
- Resolution support
- Four fixed image modes plus a dynamic tiled mode
Read from README.md, requirements.txt, DeepSeek-OCR-master/DeepSeek-OCR-vllm/config.py, DeepSeek-OCR-master/DeepSeek-OCR-hf/run_dpsk_ocr.py, DeepSeek-OCR-master/DeepSeek-OCR-vllm/deepseek_ocr.py, DeepSeek-OCR-master/DeepSeek-OCR-vllm/run_dpsk_ocr_pdf.py, DeepSeek-OCR-master/DeepSeek-OCR-vllm/run_dpsk_ocr_image.py, DeepSeek-OCR-master/DeepSeek-OCR-vllm/run_dpsk_ocr_eval_batch.py, DeepSeek-OCR-master/DeepSeek-OCR-vllm/deepencoder/clip_sdpa.py, DeepSeek-OCR-master/DeepSeek-OCR-vllm/process/image_process.py, DeepSeek-OCR-master/DeepSeek-OCR-vllm/process/ngram_norepeat.py, DeepSeek-OCR-master/DeepSeek-OCR-vllm/deepencoder/build_linear.py, DeepSeek-OCR-master/DeepSeek-OCR-vllm/deepencoder/sam_vary_sdpa.py.
What it can do
Extract text from images
Image files containing text → Extracted text content
Convert long documents to image format for processing
Long text documents → Compressed image representation
Recognize text in scanned documents
Scanned document images → Digital text
Process multi-page documents through visual understanding
Multi-page document images → Structured text data
Transform text-heavy contexts into visual format
Long-form text content → Visual representation for analysis
Perform optical character recognition on handwritten text
Images of handwritten documents → Digitized text
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.