refactor: 升级OCR依赖与适配rapidocr v3+,补充业务字段展示

主要变更:
1. 统一替换rapidocr-onnxruntime为rapidocr+onnxruntime依赖包
2. 适配rapidocr v3+ API变更:调整OCR结果解析逻辑
3. 补充展示员工岗位信息到OA审批通知
4. 优化OA详情链接格式为Markdown可点击样式
5. 修复OCR图片EXIF旋转问题与文件名解码
6. 新增RPA开发提成评分规则文档
7. 重构OA登录入口参数,简化调用逻辑
8. 删除临时测试脚本
This commit is contained in:
2026-08-27 13:32:48 +08:00
parent 54e2fef25d
commit eabadf5a37
12 changed files with 209 additions and 158 deletions
+5 -5
View File
@@ -18,7 +18,7 @@
@Version: 2.0.0
依赖(项目虚拟环境已安装):
pyautogui pywin32 pyperclip psutil pillow numpy rapidocr_onnxruntime
pyautogui pywin32 pyperclip psutil pillow numpy rapidocr onnxruntime
使用前提:
1. Windows 系统
@@ -61,7 +61,7 @@ import win32process
import psutil
from PIL import ImageGrab
import numpy as np
from rapidocr_onnxruntime import RapidOCR
from rapidocr import RapidOCR
# ==================== 默认参数 ====================
SEARCH_RETRY = 3 # 搜索并打开会话的外层重试次数(标签/会话校验的 OCR 偶发抖动由它兜底)
@@ -282,10 +282,10 @@ def ocr_image(img):
if img is None:
return []
img_np = np.array(img)
result, _ = get_ocr()(img_np)
result = get_ocr()(img_np)
ocr_data = []
if result is not None:
for box, text, score in result:
if result is not None and result.boxes is not None:
for box, text, score in zip(result.boxes, result.txts, result.scores):
xs = [p[0] for p in box]
ys = [p[1] for p in box]
x1, y1 = min(xs), min(ys)