|
|
|
@ -2174,6 +2174,8 @@ class ModelProcessor: |
|
|
|
result3: 删除边面字典,包含图像名称和对应的删除边面列表 |
|
|
|
result3: 删除边面字典,包含图像名称和对应的删除边面列表 |
|
|
|
base_path: 基础文件路径 |
|
|
|
base_path: 基础文件路径 |
|
|
|
""" |
|
|
|
""" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
os.makedirs(base_path, exist_ok = True) |
|
|
|
|
|
|
|
|
|
|
|
print(f"save_occlusion_data {base_path}, {len(result1)}, {len(result2)}, {len(result3)}") |
|
|
|
print(f"save_occlusion_data {base_path}, {len(result1)}, {len(result2)}, {len(result3)}") |
|
|
|
|
|
|
|
|
|
|
|
@ -2199,7 +2201,7 @@ class ModelProcessor: |
|
|
|
|
|
|
|
|
|
|
|
# 保存 visible_faces_map |
|
|
|
# 保存 visible_faces_map |
|
|
|
try: |
|
|
|
try: |
|
|
|
with open(base_path + "/_visible_faces_map.txt", "w", encoding='utf-8') as map_file: |
|
|
|
with open(base_path + "_visible_faces_map.txt", "w", encoding='utf-8') as map_file: |
|
|
|
for image_name, face_set in visible_faces_map.items(): |
|
|
|
for image_name, face_set in visible_faces_map.items(): |
|
|
|
# 写入图像名称和所有面ID,用空格分隔 |
|
|
|
# 写入图像名称和所有面ID,用空格分隔 |
|
|
|
line = image_name + " " + " ".join(str(face) for face in face_set) + "\n" |
|
|
|
line = image_name + " " + " ".join(str(face) for face in face_set) + "\n" |
|
|
|
@ -2209,7 +2211,7 @@ class ModelProcessor: |
|
|
|
|
|
|
|
|
|
|
|
# 保存 face_visible_relative |
|
|
|
# 保存 face_visible_relative |
|
|
|
try: |
|
|
|
try: |
|
|
|
with open(base_path + "/_face_visible_relative.txt", "w", encoding='utf-8') as relative_file: |
|
|
|
with open(base_path + "_face_visible_relative.txt", "w", encoding='utf-8') as relative_file: |
|
|
|
for face in face_visible_relative: |
|
|
|
for face in face_visible_relative: |
|
|
|
relative_file.write(str(face) + "\n") |
|
|
|
relative_file.write(str(face) + "\n") |
|
|
|
except IOError as e: |
|
|
|
except IOError as e: |
|
|
|
@ -2217,7 +2219,7 @@ class ModelProcessor: |
|
|
|
|
|
|
|
|
|
|
|
# 保存 edge_faces_map |
|
|
|
# 保存 edge_faces_map |
|
|
|
try: |
|
|
|
try: |
|
|
|
with open(base_path + "/_edge_faces_map.txt", "w", encoding='utf-8') as map_file2: |
|
|
|
with open(base_path + "_edge_faces_map.txt", "w", encoding='utf-8') as map_file2: |
|
|
|
for image_name, face_set in edge_faces_map.items(): |
|
|
|
for image_name, face_set in edge_faces_map.items(): |
|
|
|
line = image_name + " " + " ".join(str(face) for face in face_set) + "\n" |
|
|
|
line = image_name + " " + " ".join(str(face) for face in face_set) + "\n" |
|
|
|
map_file2.write(line) |
|
|
|
map_file2.write(line) |
|
|
|
@ -2226,7 +2228,7 @@ class ModelProcessor: |
|
|
|
|
|
|
|
|
|
|
|
# 保存 delete_edge_faces_map |
|
|
|
# 保存 delete_edge_faces_map |
|
|
|
try: |
|
|
|
try: |
|
|
|
with open(base_path + "/_delete_edge_faces_map.txt", "w", encoding='utf-8') as map_file3: |
|
|
|
with open(base_path + "_delete_edge_faces_map.txt", "w", encoding='utf-8') as map_file3: |
|
|
|
for image_name, face_set in delete_edge_faces_map.items(): |
|
|
|
for image_name, face_set in delete_edge_faces_map.items(): |
|
|
|
line = image_name + " " + " ".join(str(face) for face in face_set) + "\n" |
|
|
|
line = image_name + " " + " ".join(str(face) for face in face_set) + "\n" |
|
|
|
map_file3.write(line) |
|
|
|
map_file3.write(line) |
|
|
|
|