← 返回
未分类 Key

PDF to Markdown with OCR

Document OCR and parsing — converts PDF/images to Markdown on remote L4 GPU via Modal. Trigger when user says: OCR, PDF to markdown, parse PDF, extract text...
Document OCR and parsing — converts PDF/images to Markdown on remote L4 GPU via Modal. Trigger when user says: OCR, PDF to markdown, parse PDF, extract text...
speech2srt
未分类 clawhub v1.0.1 1 版本 100000 Key: 需要
★ 1
Stars
📥 402
下载
💾 0
安装
1
版本
#latest

概述

OCR2Markdown

MinerU document parsing pipeline on Modal L4 GPU — PDF/image → Markdown with layout, tables, formulas, and OCR preserved.

Pipeline code is bundled at ./src/ocr2markdown.py. After npx skills add, runs from any directory.

Workflow

1. Prepare slug and identify files

Slug = task identifier (volume directory name). Use user-provided value, or generate ocr_YYYYMMDD_HHMMSS if none given.

Directory input? Scan for PDF (.pdf), list with index, ask user to confirm selection.

Specific files? Use directly, no listing needed.

2. Upload to volume

Ensure both volumes exist (idempotent):

modal volume create speech2srt-data 2>/dev/null || true
modal volume create speech2srt-models 2>/dev/null || true

Upload each file:

modal volume put speech2srt-data <local_file> <slug>/upload/

Modal put auto-creates remote directories.

3. Run pipeline

modal run ./src/ocr2markdown.py --slug <slug>

Pipeline finds all .pdf files in /upload/ on the volume and processes them one by one.

Ctrl+C? Stop cleanly, report progress. Re-run with same slug — already-processed PDFs are skipped automatically.

4. Download results

Output directory structure:

<slug>/output/<stem>_ocr/
├── <stem>.md              # Main markdown output
├── images/                # Extracted images referenced by markdown
└── *.pdf, *.json          # Auxiliary outputs (layout, model data)

Download the entire output folder:

modal volume get speech2srt-data <slug>/output/ <local_destination>/

Preserve original directory tree.

5. Report

Done. Parsed N PDF(s) in Xs

Results:
  - <output_dir>/<stem>_ocr/<stem>.md
  - <output_dir>/<stem>_ocr/images/

Setup

Before first run, verify:

  1. Python 3.9+python -V
  2. Modal CLImodal config show:
    • token_id null → modal setup to authenticate
    • command not found → pip install modal then modal setup
  3. Modal free tier — L4 GPU is $0.80/hr. New accounts get $30 free credits/month (~37 hours of L4). No setup needed beyond authentication.

Performance

PDF SizePagesTime/PDF
---------------------------
~40-55 MBvaries~110-130s each

Pipeline auto-skips PDFs with existing output.

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-07 13:41 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Speech De-Noise, Vocal Enhancement

speech2srt
在远程(免费)L4 GPU上进行语音增强/去噪;当用户说 denoise、remove noise、clean up audio、去噪、降噪、enhance audio 时触发;接收本地音频…
★ 1 📥 547

Vocal Isolation, Background Music Removal then De-Noise

speech2srt
远程免费 L4 GPU 人声分离/背景音乐去除。用户说出“isolate vocals, remove background music, extract voice, 提取人声, 去除背景音乐”等触发。
★ 1 📥 446

Speech-to-text, 3x faster than Whisper, remote FREE GPU

speech2srt
3x Faster than Whisper, Speech-to-text transcription with sentence-level timestamps on remote (FREE) L4 GPU. Trigger whe
★ 1 📥 363