Spaces:
Build error
Build error
Create new file
Browse files
app.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, mesh_file_name
|
9 |
+
|
10 |
+
|
11 |
+
demo = gr.Interface(
|
12 |
+
fn=load_mesh,
|
13 |
+
inputs=gr.Model3D(),
|
14 |
+
outputs=[
|
15 |
+
gr.Model3D(
|
16 |
+
clear_color=[0.0, 0.0, 0.0, 0.0], label="3D Model"),
|
17 |
+
gr.File(label="Download 3D Model")
|
18 |
+
],
|
19 |
+
examples=[
|
20 |
+
["files/Bunny.obj"],
|
21 |
+
["files/Duck.glb"],
|
22 |
+
["files/Fox.gltf"],
|
23 |
+
["files/face.obj"],
|
24 |
+
],
|
25 |
+
cache_examples=True,
|
26 |
+
)
|
27 |
+
|
28 |
+
demo.launch()
|