anagri commited on
Commit
d64af88
1 Parent(s): e991f14

[Amir] showing image as output

Browse files
Files changed (3) hide show
  1. app.py +4 -4
  2. requirements.txt +2 -0
  3. 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 "Hello " + name + " from " + place + "!!"
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="text"
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