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

Đang mở
#263 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

  • #277 của @JiwaniZakir — đã đóng, không merge

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
50/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
documentation

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

执行: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'))")

Ngôn ngữ chính
Python
Star
9.3k
Fork
928
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của X-PLUG/MobileAgent

Tất cả issue của X-PLUG/MobileAgent

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.