Spaces:
Build error
Build error
Commit
·
6336d84
1
Parent(s):
3e0e04a
testing to render images from duckduck go image search using urls
Browse files- app.py +8 -1
- requirement.txt +3 -0
app.py
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
| 2 |
|
| 3 |
def greet(name):
|
| 4 |
return "Hello " + name + "!!"
|
| 5 |
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
iface.launch()
|
|
|
|
| 1 |
+
#playground
|
| 2 |
import gradio as gr
|
| 3 |
+
from fastai.vision.all import *
|
| 4 |
+
from duckduckgo_search import ddg_images
|
| 5 |
|
| 6 |
def greet(name):
|
| 7 |
return "Hello " + 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()
|
requirement.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fastai
|
| 2 |
+
gradio
|
| 3 |
+
duckduckgo_search
|