'1'
Browse files
app.py
CHANGED
|
@@ -1,12 +1,29 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
def greet(name, intensity):
|
| 4 |
-
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
demo = gr.Interface(
|
| 7 |
-
fn=
|
| 8 |
-
inputs=["text"
|
| 9 |
-
outputs=["
|
| 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)
|