Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -97,14 +97,12 @@ def segment(mesh_path, output_dir, postprocess=True, postprocess_threshold=0.95,
|
|
| 97 |
mesh_save = mesh.copy()
|
| 98 |
mesh_save.visual.face_colors = face_colors
|
| 99 |
|
| 100 |
-
# 保存结果
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
seg_mesh_path = os.path.join(output_dir, f'{input_filename}_segmented.glb')
|
| 104 |
mesh_save.export(seg_mesh_path)
|
| 105 |
print(f" -> Saved segmented mesh to: {seg_mesh_path}")
|
| 106 |
|
| 107 |
-
face_id_path = os.path.join(output_dir,
|
| 108 |
np.save(face_id_path, face_ids)
|
| 109 |
print(f" -> Saved face IDs to: {face_id_path}")
|
| 110 |
|
|
@@ -131,12 +129,10 @@ def generate(mesh_path, aabb, output_dir, seed=42):
|
|
| 131 |
**additional_params,
|
| 132 |
)
|
| 133 |
|
| 134 |
-
# 导出所有结果
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
out_bbox_path = os.path.join(output_dir, f'{input_filename}_gen_bbox.glb')
|
| 139 |
-
explode_path = os.path.join(output_dir, f'{input_filename}_gen_exploded.glb')
|
| 140 |
|
| 141 |
obj_mesh.export(obj_path)
|
| 142 |
print(f" -> Saved generated parts to: {obj_path}")
|
|
@@ -173,7 +169,6 @@ def main():
|
|
| 173 |
default='results',
|
| 174 |
help="Directory to save the output files. (default: 'results')"
|
| 175 |
)
|
| 176 |
-
# ... 其他参数保持不变 ...
|
| 177 |
parser.add_argument(
|
| 178 |
'--seed',
|
| 179 |
type=int,
|
|
|
|
| 97 |
mesh_save = mesh.copy()
|
| 98 |
mesh_save.visual.face_colors = face_colors
|
| 99 |
|
| 100 |
+
# 保存结果 (使用固定文件名)
|
| 101 |
+
seg_mesh_path = os.path.join(output_dir, 'output_segmented.glb')
|
|
|
|
|
|
|
| 102 |
mesh_save.export(seg_mesh_path)
|
| 103 |
print(f" -> Saved segmented mesh to: {seg_mesh_path}")
|
| 104 |
|
| 105 |
+
face_id_path = os.path.join(output_dir, 'output_face_ids.npy')
|
| 106 |
np.save(face_id_path, face_ids)
|
| 107 |
print(f" -> Saved face IDs to: {face_id_path}")
|
| 108 |
|
|
|
|
| 129 |
**additional_params,
|
| 130 |
)
|
| 131 |
|
| 132 |
+
# 导出所有结果 (使用固定文件名)
|
| 133 |
+
obj_path = os.path.join(output_dir, 'output_gen_parts.glb')
|
| 134 |
+
out_bbox_path = os.path.join(output_dir, 'output_gen_bbox.glb')
|
| 135 |
+
explode_path = os.path.join(output_dir, 'output_gen_exploded.glb')
|
|
|
|
|
|
|
| 136 |
|
| 137 |
obj_mesh.export(obj_path)
|
| 138 |
print(f" -> Saved generated parts to: {obj_path}")
|
|
|
|
| 169 |
default='results',
|
| 170 |
help="Directory to save the output files. (default: 'results')"
|
| 171 |
)
|
|
|
|
| 172 |
parser.add_argument(
|
| 173 |
'--seed',
|
| 174 |
type=int,
|