OCR with python

👤 roamerxv 📦 v1.0.0 ⭐ 4.1 ⬇️ 10.6K 下载
📄 办公效率 免费

📖 技能介绍


name: ocr description: Optical Character Recognition (OCR) tool, supports Chinese and English text extraction from PDFs and images. Use cases: (1) extract text from scanned PDFs, (2) recognize text from images, (3) extract text content from invoices, contracts, and other documents

7w4.net小葱技能站收录全网优质技能,值得收藏。


OCR Text Recognition

This skill uses PaddleOCR for text recognition, supporting both Chinese and English.

Quick Start

Basic Usage

Perform OCR recognition directly on image or PDF files:

from paddleocr import PaddleOCR

ocr = PaddleOCR(lang='ch')
result = ocr.predict("file_path.jpg")

Dependency Installation

Install dependencies before first use:

pip3 install paddlepaddle paddleocr

Output Format

Recognition results return JSON containing: - rec_texts: List of recognized text - rec_scores: Confidence score for each text

Typical Use Cases

  1. PDF Scans: Use PyMuPDF to extract images first, then OCR
  2. Image Text Recognition: Perform OCR directly on images
  3. Multi-page PDFs: Process page by page

Scripts

Common scripts are located in the scripts/ directory.

🤖 AI 评测

这个 OCR 技能质量中规中矩,优点是支持中文英文、能处理扫描版 PDF 和图片,功能比较实用。文档写得很清晰,中英文都有,上手容易。不足之处是缺少依赖说明文件,示例代码和实际脚本的用法不一致,容易让人困惑,另外没有测试代码,质量保障不足。总体来说能用,但细节打磨还需加强。

📊 多维度评分

适应性4
规范性3.8
有效性4
可靠性4.2
可信度4.8

📁 包含文件 (4 个)

📄 SKILL.md 1.1 KB
📄 SKILL.zh-CN.md 1021 B
📄 _meta.json 129 B
📄 scripts/ocr.py 3 KB