使用阿里的ocr服务,是否需要在配置里面加入OCR_ACCESS_KEY_ID和OCR_ACCESS_KEY_SECRET

未关闭
#263 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

  • #277 来自 @JiwaniZakir —— 已关闭,未合并

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
50/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
documentation

调研方向

The OCR credentials are consumed in PCAgent/text_localization.py. Check how the Alibaba Cloud client is initialized there and what config keys it expects, then update the project documentation or config.example.json to list OCR_ACCESS_KEY_ID and OCR_ACCESS_KEY_SECRET as required for the OCR feature. Note that linked PR #277 was closed without merging, so review it before starting.

由索引模型根据 Issue 内容生成。

描述

执行:python run.py --instruction="Open Chrome and search the PC-Agent paper." --mac 1
报错:缺失了OCR_ACCESS_KEY_ID配置

之后,我在config.json中增加了OCR_ACCESS_KEY_ID, OCR_ACCESS_KEY_SECRET。开通了OCR服务,并通过阿里云平台验证这两个参数可以解析图片。

但运行python run.py --instruction="Open Chrome and search the PC-Agent paper." --mac 1,依然连接不上,是还有什么配置问题吗?

task_1/screenshot_1.png
Traceback (most recent call last):
File "/Users/lisun/workplace/MobileAgent/PC-Agent/PCAgent/text_localization.py", line 62, in ocr
outputs = Sample.main(image)
File "/Users/lisun/workplace/MobileAgent/PC-Agent/PCAgent/text_localization.py", line 33, in main
output = client.recognize_all_text_with_options(recognize_all_text_request, runtime)
File "/Users/lisun/workplace/MobileAgent/PC-Agent/.venv/lib/python3.10/site-packages/alibabacloud_ocr_api20210707/client.py", line 354, in recognize_all_text_with_options
self.call_api(params, req, runtime)
File "/Users/lisun/workplace/MobileAgent/PC-Agent/.venv/lib/python3.10/site-packages/alibabacloud_tea_openapi/client.py", line 2015, in call_api
return self.do_request(params, request, runtime)
File "/Users/lisun/workplace/MobileAgent/PC-Agent/.venv/lib/python3.10/site-packages/alibabacloud_tea_openapi/client.py", line 1492, in do_request
raise UnretryableException(_last_request, _last_exception)
Tea.exceptions.UnretryableException: ('Connection aborted.', TimeoutError('The write operation timed out'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/lisun/workplace/MobileAgent/PC-Agent/run.py", line 647, in
perception_infos, width, height = get_perception_infos(screenshot_file, screenshot_som_file, font_path=args.font_path)
File "/Users/lisun/workplace/MobileAgent/PC-Agent/run.py", line 335, in get_perception_infos
sub_text, sub_coordinates = ocr(img) # for api
File "/Users/lisun/workplace/MobileAgent/PC-Agent/PCAgent/text_localization.py", line 64, in ocr
raise OCRError(e.message)
PCAgent.text_localization.OCRError: RetryError("('Connection aborted.', TimeoutError('The write operation timed out'))")

主要语言
Python
星标
9.3k
派生
928
平均合并
1 天 2 小时
30 天内合并 PR
3

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

X-PLUG/MobileAgent 的其他 Issue

查看 X-PLUG/MobileAgent 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。