Update app.py
Browse files
app.py
CHANGED
|
@@ -182,16 +182,18 @@ def create_3d_obj(foreground, depth_image, background, image_path, depth=10):
|
|
| 182 |
|
| 183 |
return str(gltf_path)
|
| 184 |
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
|
|
|
|
|
|
| 188 |
examples = [["examples/" + img] for img in os.listdir("examples/")]
|
| 189 |
|
| 190 |
iface = gr.Interface(
|
| 191 |
fn=process_image,
|
| 192 |
inputs=[
|
| 193 |
gr.Image(type="filepath", label="Input Image"),
|
| 194 |
-
gr.
|
| 195 |
],
|
| 196 |
outputs=[
|
| 197 |
gr.Image(label="Predicted Depth", type="pil"),
|
|
|
|
| 182 |
|
| 183 |
return str(gltf_path)
|
| 184 |
|
| 185 |
+
|
| 186 |
+
# Gradio Interface
|
| 187 |
+
title = "Depth Estimation & 3D Reconstruction Demo"
|
| 188 |
+
description = "Upload an image and optionally a depth map (in .npy or image format) to generate a 3D model. If no depth map is provided, the DPT model will generate it."
|
| 189 |
+
|
| 190 |
examples = [["examples/" + img] for img in os.listdir("examples/")]
|
| 191 |
|
| 192 |
iface = gr.Interface(
|
| 193 |
fn=process_image,
|
| 194 |
inputs=[
|
| 195 |
gr.Image(type="filepath", label="Input Image"),
|
| 196 |
+
gr.File(type="filepath", label="Input Depth Map (optional)"),
|
| 197 |
],
|
| 198 |
outputs=[
|
| 199 |
gr.Image(label="Predicted Depth", type="pil"),
|