Image Reader Skill
Image recognition and understanding tool that leverages Doubao multimodal models to analyze image content.
Features
- - Text Extraction (OCR): Extract text from images, suitable for documents, screenshots, posters, menus, etc.
- Image Description: Generate detailed descriptions of images, suitable for photos, illustrations, memes, UI screens, etc.
- General Analysis: Automatically choose the best analysis strategy based on the image type.
API Configuration
| Item | Value |
|---|
| API Endpoint | INLINECODE0 |
| Model |
doubao-seed-2.0-pro |
| Authentication | API Key (configured in config.yaml) |
Usage
Command Line
CODEBLOCK0
OpenClaw Skill Invocation
Once installed, you can invoke it using natural language:
CODEBLOCK1
Output
- - Text-heavy images: Returns all extracted text, preserving original formatting.
- Non-text images: Returns a detailed scene description, including objects, people, colors, style, etc.
- Mixed content: Provides both text extraction and a visual description.
Technical Details
- - Uses an OpenAI-compatible API to call Doubao multimodal models
- Images are sent as base64-encoded data
- The system prompt adapts to the image type to select the most appropriate analysis strategy
图像阅读技能
利用豆包多模态模型分析图像内容的图像识别与理解工具。
功能特性
- - 文本提取(OCR):从图像中提取文本,适用于文档、截图、海报、菜单等场景。
- 图像描述:生成图像的详细描述,适用于照片、插画、表情包、UI界面等场景。
- 通用分析:根据图像类型自动选择最佳分析策略。
API配置
| 项目 | 值 |
|---|
| API端点 | https://ark.cn-beijing.volces.com/api/coding/v3 |
| 模型 |
doubao-seed-2.0-pro |
| 认证方式 | API密钥(在config.yaml中配置) |
使用方法
命令行
bash
通用分析
python image_reader.py /path/to/image.png
提取文本(OCR)
python image_reader.py /path/to/image.png -p 提取图像中的所有文本
描述图像
python image_reader.py /path/to/image.png -p 详细描述这张图像
OpenClaw技能调用
安装后,您可以使用自然语言进行调用:
yaml
分析这张图像
提取图像中的文本
描述这个截图
输出结果
- - 文本密集型图像:返回所有提取的文本,保留原始格式。
- 非文本图像:返回详细的场景描述,包括物体、人物、颜色、风格等。
- 混合内容:同时提供文本提取和视觉描述。
技术细节
- - 使用兼容OpenAI的API调用豆包多模态模型
- 图像以base64编码数据形式发送
- 系统提示词会根据图像类型自适应,选择最合适的分析策略