Update app.py
Browse files
app.py
CHANGED
|
@@ -1,42 +1,37 @@
|
|
| 1 |
|
| 2 |
# Basic Interface
|
| 3 |
|
| 4 |
-
import gradio as gr
|
| 5 |
-
|
| 6 |
-
gr.Markdown("""# Miami Vice""")
|
| 7 |
-
|
| 8 |
-
demo = gr.load("mswhite/miamivice", src="models")
|
| 9 |
-
demo.launch()
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
|
|
|
|
|
|
|
| 15 |
|
| 16 |
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
| 22 |
|
| 23 |
-
|
|
|
|
| 24 |
# return pipe(text)[0]["image"]
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
|
| 29 |
-
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
|
| 39 |
-
|
| 40 |
|
| 41 |
|
| 42 |
|
|
|
|
| 1 |
|
| 2 |
# Basic Interface
|
| 3 |
|
| 4 |
+
#import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
#demo = gr.load("mswhite/miamivice", src="models")
|
| 7 |
+
#demo.launch()
|
| 8 |
|
| 9 |
|
| 10 |
+
# Detailed Interface
|
| 11 |
|
| 12 |
+
import gradio as gr
|
| 13 |
+
from transformers import pipeline
|
| 14 |
|
| 15 |
+
pipe = pipeline("text-to-image", model="mswhite/miamivice")
|
| 16 |
|
| 17 |
+
def nagelize(text):
|
| 18 |
+
return gr.Image()
|
| 19 |
# return pipe(text)[0]["image"]
|
| 20 |
|
| 21 |
+
def clear():
|
| 22 |
+
return gr.Image()
|
| 23 |
|
| 24 |
+
with gr.Blocks() as demo:
|
| 25 |
|
| 26 |
+
gr.Markdown("""# Miami Vice""")
|
| 27 |
|
| 28 |
+
art_to_draw = gr.Textbox(label="Draw")
|
| 29 |
+
output = gr.Image(label="Output")
|
| 30 |
+
clear_btn = gr.Button("Clear")
|
| 31 |
+
submit_btn = gr.Button("Submit")
|
| 32 |
+
submit_btn.click(fn=nagelize, inputs=[art_work], outputs=[output])
|
| 33 |
|
| 34 |
+
demo.launch()
|
| 35 |
|
| 36 |
|
| 37 |
|