with one click
image-understanding
对图片内容进行多维度理解与问答,识别人物、物体、场景、文字等,适用于图片打标签、内容分析、物体识别场景。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
对图片内容进行多维度理解与问答,识别人物、物体、场景、文字等,适用于图片打标签、内容分析、物体识别场景。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Generate short videos from a static image using the Kling AI image-to-video API. Use this skill whenever the user wants to animate an image, create a video from a photo, turn a picture into a video clip, or generate AI video from an uploaded image.
基于文本描述生成短视频(5s/10s),适用于电商营销、创意宣传、教育讲解等场景,异步轮询获取结果。
图片生成与编辑(超级版),调用 GPT-Image-2 模型生成和编辑图片。需要 AI 画图、生成图片、编辑图片、多图融合、背景替换、风格转换、电商商品图合成、海报设计、插画创作时优先使用该工具。纯像素操作(文字叠加、加水印、裁剪、缩放)请改用 Pillow,不要触发本工具。
调用百度通用文字识别高精度版 OCR,对图片全部文字内容进行高精度检测识别,支持中英日韩等 20+ 语种,适用于文档数字化、多语言文本提取场景。
根据用户输入的主题自动生成完整 PPT 文件,返回封面图和下载链接;适用于办公汇报、教学课件、产品展示等需要快速生成 PPT 的场景。
识别飞机行程单图片,结构化提取24个字段(乘客、航班、票价、税费等);适用于差旅报销、财务管理、行程记录场景。
| name | image-understanding |
| description | 对图片内容进行多维度理解与问答,识别人物、物体、场景、文字等,适用于图片打标签、内容分析、物体识别场景。 |
| license | MIT |
图像内容理解插件基于百度 AI 图像理解能力,支持输入图片(Base64 或 URL)和提问信息,对图片进行多维度识别与理解,包括人、物、行为、场景、文字等,并返回自然语言描述。
接口概览(注意:两个接口的 API ID 不同,不可混用):
| 接口 | API ID | 路径 | 说明 |
|---|---|---|---|
| 提交请求 | api-DYJwo27V85oa | .../image-understanding/request | 提交图片和问题,返回 task_id |
| 查询结果 | api-zYkZz8qoKDdL | .../image-understanding/get-result | 用 task_id 轮询,获取识别描述 |
工作流(异步轮询):
task_idtask_id 调用"查询结果"接口,检查 ret_code:
0:处理成功,取 description 字段1:处理中,等待后重试参数限制:
question:不超过 100 个字符,超出返回 input text length invalid (282501)认证模式: platform_managed — 密钥由平台注入,读取自 INTEGRATIONS_API_KEY 环境变量。
X-Gateway-Authorization: Bearer ${INTEGRATIONS_API_KEY}(注意不是标准的 Authorization)。异步轮询模式参考代码:
async function imageUnderstandingAndWait(
question: string,
imageBase64?: string,
imageUrl?: string
): Promise<string> {
const { taskId } = await submitImageUnderstanding(question, imageBase64, imageUrl);
const POLL_INTERVAL_MS = 3000;
const TIMEOUT_MS = 3 * 60 * 1000; // 3 分钟
const deadline = Date.now() + TIMEOUT_MS;
while (Date.now() < deadline) {
await new Promise(r => setTimeout(r, POLL_INTERVAL_MS));
const result = await getImageUnderstandingResult(taskId);
if (result.retCode === 0) return result.description;
if (result.retCode !== 1) throw new Error(`Task failed with ret_code: ${result.retCode}`);
// ret_code === 1: 处理中,继续轮询
}
throw new Error(`Task ${taskId} timed out after 3 minutes`);
}
共两个接口,详见:
references/image-understanding-request-api.md — 提交图像理解请求references/image-understanding-result-api.md — 查询图像理解结果必须为两个接口分别部署 Edge Function,轮询循环放在前端:
| Edge Function | 功能 | API ID |
|---|---|---|
image-understanding-request | 提交图片和问题,返回 task_id | api-DYJwo27V85oa |
image-understanding-result | 用 task_id 查询识别结果 | api-zYkZz8qoKDdL |
前端先调用 image-understanding-request 获取 task_id,再轮询 image-understanding-result 直至 ret_code === 0。
禁止将提交和轮询合并到同一个 Edge Function — Supabase Edge Function 有执行时间上限(60-150 秒),而图像理解任务可能需要更长时间。轮询循环放在前端,每次查询都是独立的短请求,不受 Edge Function 超时限制。
Edge Function 调用方式相同(supabase.functions.invoke),但图片获取方式因平台而异:
| 平台 | 图片来源 | 传参方式 |
|---|---|---|
| Web | File 对象 / <input> | FileReader.readAsDataURL() 转 base64 → 传 image 字段 |
| MiniProgram | wxfile:// 临时路径 | Taro.getFileSystemManager().readFile({encoding:'base64'}) 回调式读取 → 传 image 字段 |
| App | expo-image-picker 选取图片 | ImagePicker.launchImageLibraryAsync({ base64: true }) 获取 base64 → 传 image 字段 |
小程序不能将 wxfile:// 临时路径作为 url 字段传给 API — 临时路径仅存在于设备本地,外部 API 无法访问,会返回 image fetch failed (282115)。必须先读取为 base64 再通过 image 字段传递。
App 同理,不能将本地图片 URI(file://...)传给 url 字段 — 使用 expo-image-picker 时指定 base64: true 直接获取纯 Base64,通过 image 字段传递。
详见:
references/image-understanding-request-api.mdreferences/image-understanding-result-api.md