Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,7 +31,7 @@ def swap_gallery(im, images):
|
|
| 31 |
imagehash.average_hash(Image.open(imm["name"])) - im_hash, reverse = False)
|
| 32 |
return list(map(lambda x: x["name"], t2_list))
|
| 33 |
|
| 34 |
-
def lexica(prompt, limit_size = 128, ratio_size =
|
| 35 |
lex = Lexica(query=prompt).images()
|
| 36 |
lex = lex[:limit_size]
|
| 37 |
lex = list(map(lambda ele: Image.open(
|
|
@@ -43,10 +43,11 @@ def lexica(prompt, limit_size = 128, ratio_size = 512):
|
|
| 43 |
with gr.Blocks() as demo:
|
| 44 |
with gr.Row():
|
| 45 |
with gr.Tabs():
|
| 46 |
-
|
| 47 |
-
|
|
|
|
|
|
|
| 48 |
i = gr.Image()
|
| 49 |
-
text_button = gr.Button("Retrieve Images")
|
| 50 |
with gr.Tabs():
|
| 51 |
outputs = gr.Gallery(lable='Output gallery').style(grid=3,height=768,
|
| 52 |
allow_preview=False)
|
|
|
|
| 31 |
imagehash.average_hash(Image.open(imm["name"])) - im_hash, reverse = False)
|
| 32 |
return list(map(lambda x: x["name"], t2_list))
|
| 33 |
|
| 34 |
+
def lexica(prompt, limit_size = 128, ratio_size = 256 + 128):
|
| 35 |
lex = Lexica(query=prompt).images()
|
| 36 |
lex = lex[:limit_size]
|
| 37 |
lex = list(map(lambda ele: Image.open(
|
|
|
|
| 43 |
with gr.Blocks() as demo:
|
| 44 |
with gr.Row():
|
| 45 |
with gr.Tabs():
|
| 46 |
+
with gr.Row():
|
| 47 |
+
inputs = gr.Textbox(label = 'Enter prompt to search Lexica.art')
|
| 48 |
+
#gr.Slider(label='Number of images ', minimum = 4, maximum = 20, step = 1, value = 4)]
|
| 49 |
+
text_button = gr.Button("Retrieve Images")
|
| 50 |
i = gr.Image()
|
|
|
|
| 51 |
with gr.Tabs():
|
| 52 |
outputs = gr.Gallery(lable='Output gallery').style(grid=3,height=768,
|
| 53 |
allow_preview=False)
|