Summary
- 图片OCR识别工具,提取图片中的文字内容,支持中英文混合识别、代码截图优化、表格数据提取,让纯文本模型也能理解图片。
- Use when:
- - 提取图片中的文字 extract text from images
- - 代码截图识别 recognize code screenshots
- - 表格图片转结构化数据…
wulaosiji/skills
图片OCR识别工? Use when: - 提取图片中的文字 extract text from images - 代码截图识别 recognize code screenshots - 表格图片转结构化数据 convert table images to structured data - 让文本模型理解图片? - 批量图片文字提取 batch image text extraction - 文档扫描件OCR OCR scanned documents Part of UniqueClub toolkit. Learn more: https://uniqueclub.ai
npx skills add wulaosiji/skills --skill image-ocr
Related neighbors and high-traction skills in the same topics — useful to compare before installing.
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybr…
1.5K installsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or bot…
655 installsUse this skill whenever the user wants to do anything with PDF files. This includes reading or …
621 installsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.do…
570 installsUse this skill any time a spreadsheet file is the primary input or output. This means any task …
545 installsSearch Remotion documentation
3.9K installsOther skills from wulaosiji/skills · top by installs.
npx skills add wulaosiji/skills
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
main
Files included with this skill beyond the listing page.
SKILL.md
6,945 B
SUMMARY.md
686 B
将图片中的文字提取出来,让不支持视觉的模型(如 Qwen-Coder)也能"看懂"图片内容。
Chinese:
English:
| 引擎 | 特点 | 适用场景 |
|---|---|---|
| PaddleOCR | 离线、免费、中英支持好 | 日常使用、代码识别 |
| Baidu OCR | API、更准确、支持手写 | 手写体、高要求场景 |
| Tencent OCR | API、多语言 | 多语言需求 |
# config.json
{
"ocr_engine": "paddle",
"language": "ch_sim",
"save_temp": false
}
from skills.image_ocr.scripts.ocr import recognize
result = recognize("/path/to/image.png")
print(result.text)
# PaddleOCR(推荐)
pip3 install paddleocr -i https://pypi.tuna.tsinghua.edu.cn/simple
# 或完整版
pip3 install paddlepaddle paddleocr
# 基本用法
python3 skills/image-ocr/scripts/ocr.py /path/to/image.png
# 带选项
python3 skills/image-ocr/scripts/ocr.py /path/to/image.png --format markdown --save
from skills.image_ocr.ocr_engine import OCREngine
ocr = OCREngine(engine="paddle")
result = ocr.recognize("image.png")
print(result.text) # 完整文字
print(result.blocks) # 文字块详情
print(result.confidence) # 置信度
这是图片中的文字内容:
第一行文字
第二行文字
## 图片内容识别结果
def hello(): print("Hello World")
表格数据:
| 列1 | 列2 |
|-----|-----|
| A | B |
{
"text": "完整文字",
"blocks": [
{"text": "第一块", "confidence": 0.98, "position": [x1,y1,x2,y2]},
{"text": "第二块", "confidence": 0.95, "position": [x1,y1,x2,y2]}
],
"language": "ch_sim"
}
针对代码截图的特殊处理:
# 自动检测代码并格式化
ocr_result = ocr.recognize(image_path)
if is_code_screenshot(ocr_result):
formatted = format_as_code(ocr_result)
Features:
0→O,1→l){
"ocr_engine": "paddle",
"baidu_api_key": "your_key",
"baidu_secret_key": "your_secret",
"language": "ch_sim",
"save_temp": false
}
| 参数 | 选项 | 说明 |
|---|---|---|
ocr_engine |
paddle/baidu/tencent | OCR引擎选择 |
language |
chsim/en/chtra | 语言:简体中文/英文/繁体中文 |
save_temp |
true/false | 是否保存临时文件 |
if message.type == "image":
image_path = download_image(message.file_key)
ocr_result = run_skill("image-ocr", image_path)
text_prompt = f"用户发了一张图片,内容是:\n{ocr_result}\n请根据以上内容回答..."
response = query_model("qwen-coder", text_prompt)
用户:帮我识别这张图里的代码
[图片]
Agent:我来识别一下...
[调用 ocr skill]
Agent:图片里的代码是:...
Q: PaddleOCR安装失败?
# 使用 Conda 安装
conda install paddlepaddle -c conda-forge
pip install paddleocr
Q: 识别准确率不高?
language 配置Q: 支持多语言吗?
| Skill | Relationship | Use Case |
|---|---|---|
| content-extractor | 内容提取 | 提取图片内容到文本 |
| document-hub | 文档处理 | 将OCR结果生成文档 |
| 格式处理 | PDF扫描件OCR | |
| long-form-writer | 内容加工 | 基于OCR内容写作 |
| md-to-wechat | 输出转换 | 转换为公众号格式 |
skills/image-ocr/
├── SKILL.md
├── config.json # 配置文件
├── ocr_engine.py # OCR引擎封装
├── post_processor.py # 后处理(代码格式化等)
└── scripts/
└── ocr.py # CLI入口
Part of the UniqueClub toolkit - a collection of skills for AI-powered content creation and automation.