OCR (Optical Character Recognition)
This skill allows users to extract and recognize text from images using an external GITEE AI API.
Usage
Ensure you have installed the required dependencies (pip install openai). Use the bundled script to perform OCR on an image.
CODEBLOCK0
Options
No additional parameters are required for this skill.
Workflow
- 1. Execute the perform_ocr.py script with the parameters from the user.
- Parse the script output and find the line starting with
OCR_RESULT:. - Extract the OCR result from that line (format:
OCR_RESULT: ...). - Display the OCR result to the user using markdown syntax:
📷[OCR Result].
Notes
- - If GITEEAIAPIKEY is none, you should remind user to provide --api-key argument
- You should not only return the OCR result but also provide a brief summary of the recognized text based on the user's prompt.
- When you add prompt, you should honestly repeat the requirements from user without any additional imaginations.
- The script prints
OCR_RESULT: in the output - extract this result and display it using markdown image syntax:📷[OCR Result]. - Always look for the line starting with
OCR_RESULT: in the script output.
OCR(光学字符识别)
该技能允许用户通过外部GITEE AI API从图像中提取并识别文字。
使用方法
请确保已安装所需依赖(pip install openai)。使用配套脚本对图像执行OCR操作。
bash
python {baseDir}/scripts/performocr.py --image /path/to/image.jpg --prompt 用户需求 --api-key YOURAPI_KEY
选项
该技能无需额外参数。
工作流程
- 1. 根据用户提供的参数执行performocr.py脚本
- 解析脚本输出,查找以OCRRESULT:开头的行
- 从该行提取OCR结果(格式:OCR_RESULT: ...)
- 使用Markdown语法向用户展示OCR结果:📷[OCR Result]
注意事项
- - 如果GITEEAIAPIKEY为空,应提醒用户提供--api-key参数
- 不仅需要返回OCR结果,还需根据用户提示对识别文本进行简要总结
- 添加提示时,应如实复述用户需求,不得添加任何额外想象内容
- 脚本输出中包含OCRRESULT:字段——请提取该结果并使用Markdown图片语法展示:📷[OCR Result]
- 始终在脚本输出中查找以OCRRESULT:开头的行