OCR with python
Extract Chinese and English text from images and scanned PDFs, including documents like invoices and contracts, using PaddleOCR in Python.
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 textrec_scores: Confidence score for each text
Typical Use Cases
- PDF Scans: Use PyMuPDF to extract images first, then OCR
- Image Text Recognition: Perform OCR directly on images
- Multi-page PDFs: Process page by page
Scripts
Common scripts are located in the scripts/ directory.
Related skills
- Downloads
- 5kAll time
- Security audit
- Review
- Last updated
- 6mo ago
- Current version
- v1.0.0
- License
- MIT-0
