← 返回
未分类 中文

image2text

Extract text from images using tesseract OCR, supporting local files, URLs, and base64 inputs for text-only AI models without vision capability.
使用Tesseract OCR从图像中提取文字,支持本地文件、URL和Base64输入,适用于没有视觉功能的文本AI模型。
caiming0331 caiming0331 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 410
下载
💾 0
安装
1
版本
#latest

概述

image2text

Extract text from images without needing a vision-capable AI model.

Usage

python3 scripts/ocr.py <image path|URL|base64> [--lang <languages>] [--psm <mode>] [--raw]

Parameters

  • --lang: Language codes, comma-separated, default chi_sim+eng
  • chi_sim Simplified Chinese | chi_tra Traditional | eng English | jpn Japanese | kor Korean | and 30+ more
  • Combine: chi_sim+eng
  • --psm: Page segmentation mode, default 6
  • 3 Fully automatic | 6 Block-level | 4 Single line | 11 Sparse text
  • --raw: Output plain text only, no markers

Auto-Detects Input Type

  1. Local path: /Users/xxx/Downloads/xxx.png
  2. Web URL: https://example.com/image.png — OSS temp links work too
  3. Base64: Pasted image data from clipboard — just paste directly

Workflow

  1. Receive image input → auto-detect type (local path / URL / base64)
  2. URL → curl downloads to temp file
  3. Base64 → decode to temp file
  4. Run tesseract OCR
  5. Output plain text

Examples

OCR a Chinese receipt:

python3 scripts/ocr.py ~/Downloads/receipt.png --lang chi_sim

English + Chinese mixed:

python3 scripts/ocr.py https://example.com/doc.jpg --lang chi_sim+eng

Plain text only (no markers):

python3 scripts/ocr.py /path/to/image.png --raw

Requirements

  • tesseract must be installed: brew install tesseract
  • Language packs auto-installed with tesseract
  • On Mac: binary at /opt/homebrew/bin/tesseract
  • Temp files auto-deleted after execution
  • For best accuracy on receipts/screenshots: try --psm 3

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 12:48 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 80 📥 182,948
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 686 📥 330,823
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 42,074