fengfeng2 commited on
Commit
d754844
·
1 Parent(s): a92b6ad
Files changed (1) hide show
  1. app.py +22 -5
app.py CHANGED
@@ -1,12 +1,29 @@
1
  import gradio as gr
 
2
 
3
- def greet(name, intensity):
4
- return "Hello, " + name + "!" * int(intensity)
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  demo = gr.Interface(
7
- fn=greet,
8
- inputs=["text", "slider"],
9
- outputs=["text"],
10
  )
11
 
12
  demo.launch(share=True)
 
1
  import gradio as gr
2
+ from gradio_client import Client, file
3
 
4
+ # def greet(name, intensity):
5
+ # return "Hello, " + name + "!" * int(intensity)
6
 
7
+ def test(text):
8
+ client = Client("stabilityai/stable-fast-3d")
9
+ result = client.predict(
10
+ image=file('https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png'),
11
+ fr=0.85,
12
+ api_name="/requires_bg_remove"
13
+ )
14
+ # print(result)
15
+ return result
16
+
17
+
18
+ # demo = gr.Interface(
19
+ # fn=greet,
20
+ # inputs=["text", "slider"],
21
+ # outputs=["text"],
22
+ # )
23
  demo = gr.Interface(
24
+ fn=test,
25
+ inputs=["text"],
26
+ outputs=["image"],
27
  )
28
 
29
  demo.launch(share=True)