Spaces:
Running
Running
update
Browse files
app.py
CHANGED
|
@@ -427,7 +427,7 @@ def scale_to_width(img, length):
|
|
| 427 |
|
| 428 |
|
| 429 |
# Gradio Interface function
|
| 430 |
-
def process_image_and_generate_stl(image_input, depth_near, depth_far, thickness, alpha):
|
| 431 |
# Depth Estimation
|
| 432 |
raw_img = cv2.imread(image_input)
|
| 433 |
depth = model.infer_image(raw_img) # HxW raw depth map in numpy
|
|
@@ -470,7 +470,7 @@ def process_image_and_generate_stl(image_input, depth_near, depth_far, thickness
|
|
| 470 |
emboss=thickness,
|
| 471 |
f_thic=0.0, # Using 0.0 based on previous code
|
| 472 |
f_near=-thickness, # Using -thickness based on previous code
|
| 473 |
-
f_back=
|
| 474 |
vertex_colors=True,
|
| 475 |
scene_lights=True,
|
| 476 |
prepare_for_3d_printing=True,
|
|
@@ -488,6 +488,7 @@ iface = gr.Interface(
|
|
| 488 |
gr.Slider(minimum=0, maximum=1.0, value=1.0, label="Depth Far"),
|
| 489 |
gr.Slider(minimum=0.1, maximum=1.0, value=0.3, label="Thickness"),
|
| 490 |
gr.Slider(minimum=0, maximum=1.0, value=0.05, label="Alpha"),
|
|
|
|
| 491 |
],
|
| 492 |
outputs=gr.File(label="Download STL File"), # Use gr.File() for file downloads
|
| 493 |
title="Image to 2.5D Relief Model Generator",
|
|
|
|
| 427 |
|
| 428 |
|
| 429 |
# Gradio Interface function
|
| 430 |
+
def process_image_and_generate_stl(image_input, depth_near, depth_far, thickness, alpha, backsheet):
|
| 431 |
# Depth Estimation
|
| 432 |
raw_img = cv2.imread(image_input)
|
| 433 |
depth = model.infer_image(raw_img) # HxW raw depth map in numpy
|
|
|
|
| 470 |
emboss=thickness,
|
| 471 |
f_thic=0.0, # Using 0.0 based on previous code
|
| 472 |
f_near=-thickness, # Using -thickness based on previous code
|
| 473 |
+
f_back=backsheet, # Using 0.01 based on previous code
|
| 474 |
vertex_colors=True,
|
| 475 |
scene_lights=True,
|
| 476 |
prepare_for_3d_printing=True,
|
|
|
|
| 488 |
gr.Slider(minimum=0, maximum=1.0, value=1.0, label="Depth Far"),
|
| 489 |
gr.Slider(minimum=0.1, maximum=1.0, value=0.3, label="Thickness"),
|
| 490 |
gr.Slider(minimum=0, maximum=1.0, value=0.05, label="Alpha"),
|
| 491 |
+
gr.Slider(minimum=0.01, maximum=1.0, value=0.01, lavel="BackSheet Thickness")
|
| 492 |
],
|
| 493 |
outputs=gr.File(label="Download STL File"), # Use gr.File() for file downloads
|
| 494 |
title="Image to 2.5D Relief Model Generator",
|