parent
6a286e7c69
commit
6fd52609e9
|
|
@ -14,7 +14,7 @@ from datetime import datetime
|
||||||
from decimal import Decimal, ROUND_HALF_UP
|
from decimal import Decimal, ROUND_HALF_UP
|
||||||
from hashlib import md5
|
from hashlib import md5
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional, Tuple
|
from typing import Dict, Optional, Tuple
|
||||||
|
|
||||||
import cv2
|
import cv2
|
||||||
import numpy
|
import numpy
|
||||||
|
|
@ -1192,10 +1192,17 @@ if __name__ == "__main__":
|
||||||
if image_base64 is None:
|
if image_base64 is None:
|
||||||
raise RuntimeError("旋正后影像件再次压缩发生异常")
|
raise RuntimeError("旋正后影像件再次压缩发生异常")
|
||||||
|
|
||||||
global image
|
|
||||||
|
|
||||||
return image_base64, image_type, image_orientation
|
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()]:
|
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)
|
dossier["影像件层"].append(image)
|
||||||
|
|
||||||
print(dossier)
|
|
||||||
exit()
|
|
||||||
|
|
||||||
# 影像件识别使能检查,若影像件不识别则跳过
|
# 影像件识别使能检查,若影像件不识别则跳过
|
||||||
if not recognition_enable.evaluate(
|
if not recognition_enable.evaluate(
|
||||||
{
|
{
|
||||||
|
|
@ -1261,6 +1265,10 @@ if __name__ == "__main__":
|
||||||
)["result"]["recognition_enable"]:
|
)["result"]["recognition_enable"]:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# 影像件识别
|
||||||
|
recognition = image_recognize(image_base64, image_type)
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue