Spaces:
Build error
Build error
Commit
·
88cf9a2
1
Parent(s):
6336d84
return the image file itself
Browse files
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 |
-
|
|
|
|
|
|
|
12 |
|
13 |
-
iface = gr.Interface(fn=greet, inputs="text", outputs=
|
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()
|