识别结果保存到对应目录下

This commit is contained in:
2025-09-09 16:30:12 +08:00
parent 0fe49bf829
commit 532a9e75e9
6 changed files with 375 additions and 325 deletions

View File

@ -167,7 +167,19 @@ def detect(frame):
items_to_process = [line]
for item in items_to_process:
# 跳过纯数字列表(可能是坐标信息)
# 精确识别并忽略图片坐标位置信息 [[x1,y1], [x2,y2], [x3,y3], [x4,y4]]
if isinstance(item, list) and len(item) == 4: # 四边形有4个顶点
is_coordinate = True
for point in item:
# 每个顶点应该是包含2个数字的列表
if not (isinstance(point, list) and len(point) == 2 and
all(isinstance(coord, (int, float)) for coord in point)):
is_coordinate = False
break
if is_coordinate:
continue # 是坐标信息,直接忽略
# 跳过纯数字列表(其他可能的坐标形式)
if isinstance(item, list) and all(isinstance(x, (int, float)) for x in item):
continue