agentsclimarketplace

OcrCN

Skill Agents365-ai/ocrCN/skills/ocrCN

Multi-platform Chinese OCR text recognition via PaddleOCR/Baidu/Tencent/Alibaba/EasyOCR — 5 backends, all work in ChinaFrom its SKILL.md

Install
npx -y skills add Agents365-ai/ocrCN --skill ocrCN

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

16.1 KB, ~4.5k tokens by cl100k_base, as published. Nobody here has run it

ocrCN — Multi-Platform Chinese OCR Skill

Overview

Extract text from images and documents with Chinese-optimized OCR. 5 backends, all work in China.

#BackendCostKey strength
1PaddleOCR (default)FreeBest Chinese accuracy, local, offline
2Baidu AI OCR~0.004 RMB/callSpecialized doc types (ID cards, invoices)
3Tencent Cloud OCR~0.01 RMB/callSmart structural analysis, table recognition
4Alibaba Cloud OCR~0.01 RMB/callDocMind layout analysis, complex documents
5EasyOCRFreeMultilingual, simple setup, offline

Cross-platform: Windows, macOS, Linux

When to Use This Skill

Automatically activate this skill when:

  • User wants to extract text from an image (Chinese, English, or mixed)
  • User needs OCR on screenshots, scanned documents, or photos
  • Extracting Chinese text from PDFs, receipts, invoices, ID cards, or business licenses
  • Recognizing handwriting, table data, or structured forms
  • User mentions any of: OCR, text recognition, 文字识别, 图像识别, 图片转文字, PaddleOCR, Baidu OCR, 百度OCR, Tencent OCR, 腾讯OCR, Alibaba OCR, 阿里OCR, EasyOCR
  • Any task where extracting Chinese text from images would be helpful

Workflow

Step 1 — Understand the request

Clarify what the user needs:

  • Source: single image, batch of images, PDF, or screenshot?
  • Content type: printed text, handwriting, table, form, ID card, invoice?
  • Language: Chinese only, Chinese + English mixed, or multilingual?
  • Output format: plain text, JSON with coordinates, or markdown table?

Step 2 — Pick a backend

Choose based on the use case (see Backend Selection Guide). Default to PaddleOCR (local, free, best Chinese accuracy) if unsure. Mention your choice.

Step 3 — Run OCR

python skills/ocrCN/scripts/ocr.py "image.png"
# or with options
python skills/ocrCN/scripts/ocr.py --platform baidu --type id_card "id_card.jpg"

Step 4 — Report

Present the extracted text clearly. For structured documents, preserve the layout. For tables, output as markdown table.

Backend Selection Guide

Quick Pick

Use caseBackendWhy
Default / generalpaddleBest Chinese accuracy, free, offline
ID card / 身份证baiduSpecialized model, structured output
Invoice / 发票baiduVAT invoice fields auto-extracted
Business license / 营业执照baiduUnified social credit code parsing
Bank card / 银行卡baiduCard number recognition
Table / 表格tencentSmart table structure detection
Complex layoutaliDocMind: paragraphs, tables, figures
Handwriting / 手写paddleBest handwriting model
Multilingualeasyocr80+ languages, simple API
Batch processingpaddleLocal, no API cost
PDF documentspaddleDirect PDF processing
License plate / 车牌baiduSpecialized model
Seal/stamp / 印章baiduRed stamp detection and recognition
Cost-sensitivepaddleCompletely free, unlimited calls

Full Capability Comparison

CapabilityPaddleOCRBaidu AITencent CloudAlibaba CloudEasyOCR
Cost (per 1K calls)Free~4元~10元~10元Free
Chinese accuracy⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
English accuracy⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Handwriting✅ Best⚠️ Limited
Vertical text⚠️ Limited
Table recognition✅ Smart✅ DocMind
PDF input
Structured outputJSON+bboxJSON+fieldsJSON+structureJSON+layoutText+bbox
Specialized models15+50+20+10+General only
Batch processing
Offline
GPU acceleration✅ CUDACloudCloudCloud✅ CUDA
Setup difficultyMediumEasyMediumMediumEasy
API keyNoneBAIDU_*TENCENT_*ALIBABA_*None
Max image sizeUnlimited4 MB7 MB20 MBUnlimited

Platform Details

1. PaddleOCR (Default — Free, Local)

Baidu's open-source OCR engine. The gold standard for Chinese OCR. No API key, no internet required, no usage limits.

Key features:

  • 15+ specialized models: text detection, recognition, table, formula, seal
  • PP-OCRv5: state-of-the-art Chinese + English
  • GPU acceleration via CUDA
  • PDF and image input
  • JSON output with bounding boxes and confidence scores

Installation:

pip install paddlepaddle paddleocr

Best for: General Chinese OCR, handwriting, batch processing, privacy-sensitive documents.

2. Baidu AI OCR (Cloud API)

Baidu's cloud OCR service with 50+ specialized models for Chinese document types.

Specialized models include:

  • ID card (身份证), business license (营业执照), VAT invoice (增值税发票)
  • Bank card (银行卡), driver's license (驾驶证), vehicle license (行驶证)
  • Table recognition, seal/stamp recognition, license plate
  • Handwriting, formula, form fields

Installation:

pip install requests

Best for: Structured documents (ID cards, invoices), when specialized field extraction is needed.

3. Tencent Cloud OCR (Cloud API)

Tencent's OCR with smart structural analysis — auto-detects tables, forms, paragraphs.

Installation:

pip install tencentcloud-sdk-python-ocr

Best for: Complex forms, smart table extraction, mixed content documents.

4. Alibaba Cloud OCR (Cloud API)

Alibaba's DocMind service — document layout analysis that separates text, tables, and figures.

Installation:

pip install alibabacloud_ocr_api20210707

Best for: Complex multi-column layouts, magazines, academic papers, mixed text/table/figure documents.

5. EasyOCR (Free, Local)

General-purpose multilingual OCR. Simpler than PaddleOCR but less accurate for Chinese.

Installation:

pip install easyocr

Best for: Quick multilingual needs, simple documents, when PaddleOCR setup is too heavy.

Usage

Basic Usage

# Default (PaddleOCR, free, local)
python skills/ocrCN/scripts/ocr.py image.png

# Output to file
python skills/ocrCN/scripts/ocr.py image.png -o result.txt

# JSON output with bounding boxes
python skills/ocrCN/scripts/ocr.py --format json image.png

# Specify language
python skills/ocrCN/scripts/ocr.py --lang ch image.png
python skills/ocrCN/scripts/ocr.py --lang ch_en image.png

Cloud Backends

# Baidu AI — ID card recognition
BAIDU_APP_ID="xxx" BAIDU_API_KEY="xxx" BAIDU_SECRET_KEY="xxx" \
python skills/ocrCN/scripts/ocr.py --platform baidu --type id_card id_card.jpg

# Baidu AI — VAT invoice
BAIDU_APP_ID="xxx" BAIDU_API_KEY="xxx" BAIDU_SECRET_KEY="xxx" \
python skills/ocrCN/scripts/ocr.py --platform baidu --type invoice invoice.jpg

# Tencent Cloud — table recognition
TENCENT_SECRET_ID="xxx" TENCENT_SECRET_KEY="xxx" \
python skills/ocrCN/scripts/ocr.py --platform tencent --type table form.png

# Alibaba Cloud — layout analysis
ALIBABA_ACCESS_KEY_ID="xxx" ALIBABA_ACCESS_KEY_SECRET="xxx" \
python skills/ocrCN/scripts/ocr.py --platform ali --layout document.png

# EasyOCR — multilingual
python skills/ocrCN/scripts/ocr.py --platform easyocr --lang ch_sim image.png

Advanced Options

# Handwriting recognition (PaddleOCR)
python skills/ocrCN/scripts/ocr.py --handwriting handwritten.jpg

# Table extraction (PaddleOCR)
python skills/ocrCN/scripts/ocr.py --table table.png

# Batch processing
python skills/ocrCN/scripts/ocr.py images/*.png -o results/

# PDF processing (PaddleOCR)
python skills/ocrCN/scripts/ocr.py document.pdf

# Confidence threshold
python skills/ocrCN/scripts/ocr.py --min-confidence 0.8 image.png

# Visualize results (draw bounding boxes on output image)
python skills/ocrCN/scripts/ocr.py --visualize image.png -o result.png

# Dry run (preview without processing)
python skills/ocrCN/scripts/ocr.py --dry-run image.png

# List all options
python skills/ocrCN/scripts/ocr.py --list

Doc Types (Baidu AI Specialized Models)

When using --platform baidu --type <type>, the following specialized models are available:

TypeDescriptionReturns
generalGeneral text (default)Text + confidence
id_card身份证Name, ID number, address, photo fields
invoice增值税发票Invoice code, amount, date, seller/buyer
business_license营业执照Company name, legal rep, registered capital
bank_card银行卡Card number, bank name
driver_license驾驶证Name, license number, vehicle type
vehicle_license行驶证Plate number, vehicle model, VIN
table表格识别Structured table as JSON/CSV
seal印章识别Seal text content
license_plate车牌识别Plate number, color
form表单识别Key-value pairs from forms
handwriting手写识别Handwritten text
formula公式识别LaTeX or plain formula text
receipt票据识别Receipt amount, date, merchant

Requirements

# Core (always needed)
pip install paddlepaddle paddleocr  # For PaddleOCR (default, free, best Chinese)

# Optional backends — install only what you use
pip install requests                          # Baidu AI
pip install tencentcloud-sdk-python-ocr       # Tencent Cloud
pip install alibabacloud_ocr_api20210707      # Alibaba Cloud
pip install easyocr                           # EasyOCR

Environment Variables

# Global defaults (optional)
export OCR_BACKEND="paddle"
export OCR_LANG="ch"

# Baidu AI OCR
export BAIDU_APP_ID="your_app_id"
export BAIDU_API_KEY="your_api_key"
export BAIDU_SECRET_KEY="your_secret_key"

# Tencent Cloud OCR
export TENCENT_SECRET_ID="your_secret_id"
export TENCENT_SECRET_KEY="your_secret_key"

# Alibaba Cloud OCR (DocMind)
export ALIBABA_ACCESS_KEY_ID="your_access_key_id"
export ALIBABA_ACCESS_KEY_SECRET="your_access_key_secret"

# PaddleOCR (optional)
export PADDLE_DEVICE="cpu"       # cpu or gpu
export PADDLE_LANG="ch"          # ch, en, ch_en

Get API Keys:

Config File (Optional)

Create ~/.ocrCN.json for personal defaults, or .ocrCN.json in a project directory:

{
  "backend": "paddle",
  "lang": "ch",
  "min_confidence": 0.8
}

Priority (highest first):

  1. CLI arguments (--platform, --lang, --type)
  2. Project config (.ocrCN.json in current directory)
  3. User config (~/.ocrCN.json)
  4. Environment variables (OCR_BACKEND, OCR_LANG)
  5. Built-in defaults

Examples

Quick Text Extraction (Free, Local)

python skills/ocrCN/scripts/ocr.py screenshot.png
# → 今天天气真好,适合出去走走。
#   从明天开始,新一轮冷空气将影响我国大部分地区。

Chinese + English Mixed

python skills/ocrCN/scripts/ocr.py --lang ch_en mixed_text.png
# → 我们使用 Python 3.11 和 PyTorch 2.0 进行模型训练。
#   The BLEU score reached 42.8 on the WMT22 test set.

ID Card Recognition (Baidu AI)

BAIDU_APP_ID="xxx" BAIDU_API_KEY="xxx" BAIDU_SECRET_KEY="xxx" \
python skills/ocrCN/scripts/ocr.py --platform baidu --type id_card shenfenzheng.jpg
# → 姓名: 张三
#   性别: 男
#   民族: 汉
#   出生: 1990-01-15
#   住址: 北京市海淀区中关村大街1号
#   公民身份号码: 11010819900115XXXX

Invoice Data Extraction (Baidu AI)

BAIDU_APP_ID="xxx" BAIDU_API_KEY="xxx" BAIDU_SECRET_KEY="xxx" \
python skills/ocrCN/scripts/ocr.py --platform baidu --type invoice fapiao.jpg
# → 发票代码: 011001900111
#   发票号码: 12345678
#   开票日期: 2026-07-09
#   价税合计: ¥1,234.56
#   销售方名称: 北京科技有限公司

Table to Markdown (Tencent Cloud)

TENCENT_SECRET_ID="xxx" TENCENT_SECRET_KEY="xxx" \
python skills/ocrCN/scripts/ocr.py --platform tencent --type table --format markdown table.png
# → | 姓名 | 部门 | 职位 | 入职日期 |
#   |------|------|------|----------|
#   | 张三 | 研发部 | 工程师 | 2020-03-15 |
#   | 李四 | 产品部 | 经理 | 2019-07-01 |

Complex Document Layout (Alibaba DocMind)

ALIBABA_ACCESS_KEY_ID="xxx" ALIBABA_ACCESS_KEY_SECRET="xxx" \
python skills/ocrCN/scripts/ocr.py --platform ali --layout paper.png
# → [Paragraph] Introduction
#   Recent advances in natural language processing...
#   [Table 1] Model comparison results
#   | Model | BLEU | Speed |
#   ...
#   [Figure 1] Architecture overview (omitted)

Handwriting Recognition (PaddleOCR)

python skills/ocrCN/scripts/ocr.py --handwriting handwritten_note.jpg
# → 今天下午三点开会,记得带笔记本。
#   老板说要讨论下个季度的销售目标。

Batch Process with Visualize

python skills/ocrCN/scripts/ocr.py --visualize screenshots/*.png -o results/
# Processes each image and saves:
#   results/screenshot1.png (with bounding boxes)
#   results/screenshot1.txt (extracted text)
#   results/screenshot2.png
#   results/screenshot2.txt

PDF to Text (PaddleOCR)

python skills/ocrCN/scripts/ocr.py contract.pdf -o contract.txt
# Extracts text from all pages of the PDF

Agent-Native CLI Reference

ocrCN follows the agent-native-design contract. It serves humans (readable terminal output), AI agents (structured JSON on stdout), and orchestrators (distinct exit codes) simultaneously.

JSON Mode

# Explicit JSON mode
python skills/ocrCN/scripts/ocr.py --format json image.png

# Auto-detect: pipe to jq → JSON automatically
python skills/ocrCN/scripts/ocr.py --list | jq .data.backends[0].name

# Error envelope always structured
python skills/ocrCN/scripts/ocr.py --format json --platform baidu image.png
# → {"ok":false, "error":{"code":"auth_missing_env","message":"...","retryable":false,...}}

Output Envelope

// Success
{"ok":true, "data":{
  "text": "extracted text...",
  "blocks": [{"text":"...", "confidence":0.98, "bbox":[x1,y1,x2,y2,x3,y3,x4,y4]}],
  "stats": {"chars":123, "blocks":5, "lang":"ch", "time_ms": 450}
}, "meta":{"version":"1.0.0","schema_version":"1.0.0","timestamp":"...","ms":450}}

// Error
{"ok":false, "error":{"code":"file_not_found","message":"image.png does not exist","retryable":false,"field":"input"}, "meta":{...}}

Exit Codes

CodeMeaningAgent action
0SuccessParse data, proceed
1Internal / runtime errorReport to user, do not retry
2Validation / input errorFix input, retry allowed
3Auth / missing credentialsAsk user for API key, do not retry
4Backend API errorRetry with backoff
5File not found / unreadableFix path, retry allowed

Schema Introspection

ocr.py schema backends              # All 5 backends (compact by default)
ocr.py schema backends --full       # All fields per backend
ocr.py schema backends.baidu        # Single backend full detail
ocr.py schema doctypes              # All specialized doc types (Baidu)
ocr.py schema version               # Version info

Agent Compatibility Flags

# No-ops accepted for agent runtime compatibility
ocr.py --yes --no-input image.png

What ships with it: 9 files

51.5 KB alongside SKILL.md, 8 of them executable

data/

scripts/

Keep looking

Skills are one crate of 326,758. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.