Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -271,13 +271,12 @@ def run_triposg(image_path: str,
|
|
| 271 |
|
| 272 |
# Merge and color
|
| 273 |
merged = get_colored_mesh_composition(outputs)
|
| 274 |
-
|
|
|
|
| 275 |
merged_path = os.path.join(export_dir, "object.glb")
|
| 276 |
merged.export(merged_path)
|
| 277 |
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
split_preview_path = os.path.join(export_dir, "object.glb")
|
| 281 |
split_mesh.export(split_preview_path)
|
| 282 |
|
| 283 |
return merged_path, split_preview_path, export_dir, zip_path
|
|
@@ -345,10 +344,11 @@ def build_demo():
|
|
| 345 |
</p>
|
| 346 |
"""
|
| 347 |
)
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
|
|
|
| 352 |
with gr.Row():
|
| 353 |
with gr.Column():
|
| 354 |
examples = gr.Examples(
|
|
|
|
| 271 |
|
| 272 |
# Merge and color
|
| 273 |
merged = get_colored_mesh_composition(outputs)
|
| 274 |
+
split_mesh = explode_mesh(merged)
|
| 275 |
+
|
| 276 |
merged_path = os.path.join(export_dir, "object.glb")
|
| 277 |
merged.export(merged_path)
|
| 278 |
|
| 279 |
+
split_preview_path = os.path.join(export_dir, "split.glb")
|
|
|
|
|
|
|
| 280 |
split_mesh.export(split_preview_path)
|
| 281 |
|
| 282 |
return merged_path, split_preview_path, export_dir, zip_path
|
|
|
|
| 344 |
</p>
|
| 345 |
"""
|
| 346 |
)
|
| 347 |
+
with gr.Row():
|
| 348 |
+
output_model = gr.Model3D(label="Merged 3D Object")
|
| 349 |
+
split_model = gr.Model3D(label="Split Preview")
|
| 350 |
+
output_dir = gr.Textbox(label="Export Directory", visible=False)
|
| 351 |
+
download_zip = gr.File(label="Download All Parts (zip)", visible=False)
|
| 352 |
with gr.Row():
|
| 353 |
with gr.Column():
|
| 354 |
examples = gr.Examples(
|