-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Description
🔎 Search before asking
- I have searched the PaddleOCR Docs and found no similar bug report.
- I have searched the PaddleOCR Issues and found no similar bug report.
- I have searched the PaddleOCR Discussions and found no similar bug report.
🐛 Bug (问题描述)
self.ocr = PaddleOCR(
use_doc_orientation_classify=False,
use_doc_unwarping=False,
use_textline_orientation=False)
result = self.ocr.predict(screenshot_list)
交替出现错误,请问是什么问题?
🏃♂️ Environment (运行环境)
-
Python环境信息:
版本: 3.12.4 (main, Jul 23 2024, 07:23:10) [GCC 12.2.0]
平台: Linux-3.10.0-1160.71.1.el7.x86_64-x86_64-with-glibc2.36
执行路径: /usr/local/bin/python -
关键包版本:
uiautomator2: 3.5.0
paddleocr: 3.3.2
paddlepaddle: 3.2.2
opencv-python: 4.10.0
numpy: 2.0.0
requests: 2.31.0
Pillow: 10.1.0
🌰 Minimal Reproducible Example (最小可复现问题的Demo)
import uiautomator2 as u2
import time
import numpy as np
import cv2
from paddleocr import PaddleOCR
from concurrent.futures import ThreadPoolExecutor, as_completed
import traceback
'''有代码省略‘’‘
screenshot_list=[]
pil_img = d.screenshot()
crop_img = pil_img.crop(self.screenshot_bounds)
#crop_img.save(f'crop_{code}.png')
cv2_image = cv2.cvtColor(np.array(crop_img), cv2.COLOR_RGB2BGR)
screenshot_list.append(cv2_image)
try:
result = self.ocr.predict(screenshot_list)
except Exception as e:
print(f'{code_list} ocr处理图片发生错误')
manager = uiautomator.DeviceManager(device_configs)
failed = manager.initialize_all_devices()
if failed:
print(f"以下设备初始化失败: {failed}")
count = 0
for i in range(0, len(code_list), size):
search_list = code_list[i:i + size]
try:
temp_list = manager.execute_parallel(search_list)
print(f"执行结果 {temp_list}")
except Exception as e:
print(f"执行失败: {e}")