Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -100,9 +100,19 @@ def create_3d_obj(rgb_image, depth_image, image_path, depth=10):
|
|
100 |
return gltf_path
|
101 |
|
102 |
|
103 |
-
title = "zero-shot depth estimation with DPT + 3D Point Cloud"
|
104 |
-
description = "DPT model to predict the depth of an image and 3D Point Cloud to create a 3D object."
|
105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
|
107 |
iface = gr.Interface(fn=process_image,
|
108 |
inputs=[gr.Image(
|
@@ -117,6 +127,10 @@ iface = gr.Interface(fn=process_image,
|
|
117 |
allow_flagging="never",
|
118 |
cache_examples=False)
|
119 |
|
|
|
|
|
|
|
|
|
120 |
|
121 |
|
122 |
|
|
|
100 |
return gltf_path
|
101 |
|
102 |
|
103 |
+
title = "Demo: zero-shot depth estimation with DPT + 3D Point Cloud"
|
104 |
+
description = "This demo is a variation from the original <a href='https://huggingface.co/spaces/nielsr/dpt-depth-estimation' target='_blank'>DPT Demo</a>. It uses the DPT model to predict the depth of an image and then uses 3D Point Cloud to create a 3D object."
|
105 |
+
|
106 |
+
# Add both image and model examples
|
107 |
+
examples = [
|
108 |
+
["examples/" + img] for img in os.listdir("files/")
|
109 |
+
] + [
|
110 |
+
[os.path.join(os.path.dirname(__file__), "files/model1.glb")],
|
111 |
+
[os.path.join(os.path.dirname(__file__), "files/model2.glb")],
|
112 |
+
[os.path.join(os.path.dirname(__file__), "files/model3.glb")],
|
113 |
+
[os.path.join(os.path.dirname(__file__), "files/model4.glb")],
|
114 |
+
["https://huggingface.co/datasets/dylanebert/3dgs/resolve/main/bonsai/bonsai-7k-mini.splat"],
|
115 |
+
]
|
116 |
|
117 |
iface = gr.Interface(fn=process_image,
|
118 |
inputs=[gr.Image(
|
|
|
127 |
allow_flagging="never",
|
128 |
cache_examples=False)
|
129 |
|
130 |
+
if __name__ == "__main__":
|
131 |
+
iface.launch()
|
132 |
+
|
133 |
+
|
134 |
|
135 |
|
136 |
|