From 6fd52609e959fa4a453f1d4acd73081ee1ebb17d Mon Sep 17 00:00:00 2001 From: liubiren Date: Wed, 10 Dec 2025 22:09:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=B8=B8=E6=9B=B4=E6=96=B0=20from=20N?= =?UTF-8?q?UC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 票据理赔自动化/main.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/票据理赔自动化/main.py b/票据理赔自动化/main.py index e86fdb2..d046bd8 100644 --- a/票据理赔自动化/main.py +++ b/票据理赔自动化/main.py @@ -14,7 +14,7 @@ from datetime import datetime from decimal import Decimal, ROUND_HALF_UP from hashlib import md5 from pathlib import Path -from typing import Optional, Tuple +from typing import Dict, Optional, Tuple import cv2 import numpy @@ -1192,10 +1192,17 @@ if __name__ == "__main__": if image_base64 is None: raise RuntimeError("旋正后影像件再次压缩发生异常") - global image - return image_base64, image_type, image_orientation + # noinspection PyShadowingNames + def image_recognize(image_base64, image_type) -> Optional[Dict]: + """ + 影像件分类并旋正 + :param image_base64: 影像件BASE64编码 + :param image_type: 影像件类型 + :return: 影像件识别内容 + """ + # 遍历工作目录中赔案目录并创建赔案档案(模拟自动化域就待自动化任务创建理赔档案) for case_path in [x for x in directory_path.iterdir() if x.is_dir()]: # 初始化赔案档案(实际报案层包括保险分公司名称、报案渠道、批次号、报案号和报案时间等) @@ -1249,9 +1256,6 @@ if __name__ == "__main__": # 将影像件数据添加至影像件层 dossier["影像件层"].append(image) - print(dossier) - exit() - # 影像件识别使能检查,若影像件不识别则跳过 if not recognition_enable.evaluate( { @@ -1261,6 +1265,10 @@ if __name__ == "__main__": )["result"]["recognition_enable"]: continue + # 影像件识别 + recognition = image_recognize(image_base64, image_type) + + """