andreped commited on
Commit
68301e4
1 Parent(s): 2fd748f

Added 3D rendering demo + ignore gradio stuff [no ci]

Browse files
Files changed (2) hide show
  1. .gitignore +6 -0
  2. demo/app.py +19 -4
.gitignore CHANGED
@@ -8,3 +8,9 @@ livermask.egg-info/
8
  *.nii
9
  *__pycache__/
10
  .idea/
 
 
 
 
 
 
 
8
  *.nii
9
  *__pycache__/
10
  .idea/
11
+ *.glb
12
+ gradio_cached_examples/
13
+ flagged/
14
+ files/
15
+ *.csv
16
+ *.txt
demo/app.py CHANGED
@@ -1,7 +1,22 @@
1
  import gradio as gr
 
2
 
3
- def greet(name):
4
- return "Hello" + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", output="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ import subprocess as sp
3
 
4
+ def download_testdata():
5
+ sp.check_call(["wget", "https://github.com/gradio-app/gradio/raw/main/demo/model3D/files/Duck.glb"])
6
 
7
+ def load_mesh(mesh_file_name):
8
+ return mesh_file_name
9
+
10
+ demo = gr.Interface(
11
+ fn=load_mesh,
12
+ inputs=gr.Model3D(),
13
+ outputs=gr.Model3D(clear_color=[0.0, 0.0, 0.0, 0.0], label="3D Model"),
14
+ examples=[
15
+ ["Duck.glb"],
16
+ ],
17
+ cache_examples=True,
18
+ )
19
+
20
+ if __name__ == "__main__":
21
+ download_testdata()
22
+ demo.launch()