bigyunicorn commited on
Commit
88cf9a2
·
1 Parent(s): 6336d84

return the image file itself

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -8,7 +8,10 @@ def greet(name):
8
 
9
  def returnImages(keyword):
10
  urls= L(ddg_images(keyword, max_results=5)).itemgot("image")
11
- return [urls[0], urls[1]]
 
 
 
12
 
13
- iface = gr.Interface(fn=greet, inputs="text", outputs=["image","image"],)
14
  iface.launch()
 
8
 
9
  def returnImages(keyword):
10
  urls= L(ddg_images(keyword, max_results=5)).itemgot("image")
11
+ dest = Path()
12
+ fpath = download_url(urls[0], dest, show_progress = False)
13
+ im = Image.open(fpath).to_thumb(256,512)
14
+ return im
15
 
16
+ iface = gr.Interface(fn=greet, inputs="text", outputs="image")
17
  iface.launch()