Skip to content

deepseekvl2 pdf ocr.stub

Nicolas Cravino edited this page Apr 13, 2026 · 2 revisions

id: deepseekvl2-pdf-ocr name: deepseekvl2-PDF-OCR-private repo_path: ~/Documents/sw30labs/repos/deepseekvl2-PDF-OCR-private remote_url: https://github.com/sw30labs/deepseekvl2-PDF-OCR-private.git primary_language: Python framework: DeepSeek-VL2 + PyTorch + NVIDIA CUDA ingested: 2026-04-13 last_commit_date: 2025-02-09

Purpose

Local PDF OCR engine using state-of-the-art DeepSeek-VL2 mixture-of-experts vision-language model on NVIDIA CUDA GPUs. Supports single and batch PDF processing with automatic multi-GPU parallel distribution for faster extraction.

Architecture

  • Single + batch modes: Processes one PDF or entire directory with auto-GPU distribution
  • Multi-GPU parallel processing: Custom modified DeepSeek-VL2 inference.py for device management and tensor handling
  • Patching system: apply_patches.py automatically backs up and applies multi-GPU modifications
  • PDF → Image conversion: pdf2image for page extraction to temporary JPEG sequence
  • Markdown output: Structured markdown with page sections and extracted text
  • Model variants: tiny (~8GB), small (~12GB), base (~16GB) with configurable batch sizes
  • Progress tracking: Per-PDF status and detailed logging
  • Cleanup: Automatic temporary image removal post-processing

Dependencies

  • torch - PyTorch deep learning framework (CUDA)
  • transformers - DeepSeek-VL2 model loading and inference
  • pdf2image - PDF page to image conversion
  • Pillow - image processing and manipulation
  • tqdm - progress bar tracking
  • Python stdlib (argparse, os, subprocess, pathlib)

Key Features

  • State-of-the-art DeepSeek-VL2 MoE vision-language model
  • Local processing (no cloud API, full privacy)
  • Single PDF or batch directory processing
  • Multi-GPU parallel processing with custom modifications
  • Model variant selection (tiny, small, base)
  • CUDA-optimized inference
  • Markdown output with page structure
  • Progress tracking and detailed logging
  • Memory optimization strategies
  • Error handling with recovery

Tags

  • python
  • ocr
  • local-inference
  • torch
  • security
  • developer-tools

Entities and Topics

Clone this wiki locally