Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,23 +1,22 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
|
| 4 |
-
|
| 5 |
def load_mesh(mesh_file_name):
|
| 6 |
-
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
demo = gr.Interface(
|
| 10 |
fn=load_mesh,
|
| 11 |
inputs=gr.Model3D(),
|
| 12 |
-
outputs=gr.Model3D(
|
| 13 |
-
clear_color=[0.0, 0.0, 0.0, 0.0], label="3D Model"),
|
| 14 |
examples=[
|
| 15 |
-
[
|
| 16 |
-
[
|
| 17 |
-
[
|
| 18 |
-
[
|
| 19 |
],
|
| 20 |
)
|
| 21 |
|
| 22 |
if __name__ == "__main__":
|
| 23 |
-
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
|
|
|
|
| 4 |
def load_mesh(mesh_file_name):
|
| 5 |
+
if os.path.exists(mesh_file_name):
|
| 6 |
+
return mesh_file_name
|
| 7 |
+
return None
|
| 8 |
|
| 9 |
demo = gr.Interface(
|
| 10 |
fn=load_mesh,
|
| 11 |
inputs=gr.Model3D(),
|
| 12 |
+
outputs=gr.Model3D(clear_color=[0.0, 0.0, 0.0, 0.0], label="3D Model"),
|
|
|
|
| 13 |
examples=[
|
| 14 |
+
["files/model1.glb"],
|
| 15 |
+
["files/model2.glb"],
|
| 16 |
+
["files/model3.glb"],
|
| 17 |
+
["files/model4.glb"],
|
| 18 |
],
|
| 19 |
)
|
| 20 |
|
| 21 |
if __name__ == "__main__":
|
| 22 |
+
demo.launch()
|