Spaces:
Running
Running
Create new file
Browse files
app.py
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import time
|
2 |
+
import gradio as gr
|
3 |
+
import os
|
4 |
+
|
5 |
+
|
6 |
+
def load_mesh(mesh_file_name):
|
7 |
+
time.sleep(2)
|
8 |
+
return mesh_file_name
|
9 |
+
|
10 |
+
|
11 |
+
inputs = gr.Model3D()
|
12 |
+
outputs = gr.Model3D(clear_color=[0.8, 0.2, 0.2, 1.0])
|
13 |
+
|
14 |
+
demo = gr.Interface(
|
15 |
+
fn=load_mesh,
|
16 |
+
inputs=inputs,
|
17 |
+
outputs=outputs,
|
18 |
+
examples=[
|
19 |
+
[os.path.join(os.path.dirname(__file__), "files/Bunny.obj")],
|
20 |
+
[os.path.join(os.path.dirname(__file__), "files/Duck.glb")],
|
21 |
+
[os.path.join(os.path.dirname(__file__), "files/Fox.gltf")],
|
22 |
+
[os.path.join(os.path.dirname(__file__), "files/face.obj")],
|
23 |
+
],
|
24 |
+
cache_examples=True,
|
25 |
+
)
|
26 |
+
|
27 |
+
demo.launch()
|