anagri commited on
Commit ·
d64af88
1
Parent(s): e991f14
[Amir] showing image as output
Browse files- app.py +4 -4
- requirements.txt +2 -0
- sample.jpg +0 -0
app.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
|
|
|
|
| 3 |
|
| 4 |
def greet(name, place):
|
| 5 |
-
return
|
| 6 |
-
|
| 7 |
|
| 8 |
iface = gr.Interface(
|
| 9 |
title="Dialogue Box",
|
|
@@ -13,7 +13,7 @@ iface = gr.Interface(
|
|
| 13 |
gr.Textbox(placeholder="in 1", value="in 1"),
|
| 14 |
gr.Textbox(placeholder="in 2", value="in 2"),
|
| 15 |
],
|
| 16 |
-
outputs=
|
| 17 |
)
|
| 18 |
|
| 19 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from PIL import Image
|
| 3 |
+
from numpy import asarray
|
| 4 |
|
| 5 |
def greet(name, place):
|
| 6 |
+
return asarray(Image.open('sample.jpg'))
|
|
|
|
| 7 |
|
| 8 |
iface = gr.Interface(
|
| 9 |
title="Dialogue Box",
|
|
|
|
| 13 |
gr.Textbox(placeholder="in 1", value="in 1"),
|
| 14 |
gr.Textbox(placeholder="in 2", value="in 2"),
|
| 15 |
],
|
| 16 |
+
outputs=gr.Image()
|
| 17 |
)
|
| 18 |
|
| 19 |
iface.launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Pillow
|
| 2 |
+
numpy
|
sample.jpg
ADDED
|