Spaces:
Sleeping
Sleeping
add 3D model preview window
Browse files
app.py
CHANGED
|
@@ -479,7 +479,7 @@ def process_image_and_generate_stl(image_input, depth_near, depth_far, thickness
|
|
| 479 |
lift_height=-lift
|
| 480 |
)
|
| 481 |
|
| 482 |
-
return stl_path # Return the path to the generated STL file
|
| 483 |
|
| 484 |
|
| 485 |
# Gradio Interface definition
|
|
@@ -494,7 +494,10 @@ iface = gr.Interface(
|
|
| 494 |
gr.Slider(minimum=0.01, maximum=0.1, value=0.01, label="BackSheet Thickness"),
|
| 495 |
gr.Slider(minimum=0, maximum=0.1, value=0.0, label="lift"),
|
| 496 |
],
|
| 497 |
-
outputs=
|
|
|
|
|
|
|
|
|
|
| 498 |
title="Image to 2.5D Relief Model Generator",
|
| 499 |
description="Upload an image, set parameters, and generate a 2.5D relief model (.stl file)."
|
| 500 |
)
|
|
|
|
| 479 |
lift_height=-lift
|
| 480 |
)
|
| 481 |
|
| 482 |
+
return stl_path, stl_path # Return the path to the generated STL file
|
| 483 |
|
| 484 |
|
| 485 |
# Gradio Interface definition
|
|
|
|
| 494 |
gr.Slider(minimum=0.01, maximum=0.1, value=0.01, label="BackSheet Thickness"),
|
| 495 |
gr.Slider(minimum=0, maximum=0.1, value=0.0, label="lift"),
|
| 496 |
],
|
| 497 |
+
outputs=[
|
| 498 |
+
gr.File(label="Download STL File"),
|
| 499 |
+
gr.Model3D(label="STL Preview")
|
| 500 |
+
], # Use gr.File() for file downloads
|
| 501 |
title="Image to 2.5D Relief Model Generator",
|
| 502 |
description="Upload an image, set parameters, and generate a 2.5D relief model (.stl file)."
|
| 503 |
)
|