Spaces:
Sleeping
Sleeping
Daniel Varga
commited on
Commit
·
d1fe6b0
1
Parent(s):
f313504
more search results
Browse files
app.py
CHANGED
|
@@ -106,8 +106,8 @@ def drop_same_folder(indices):
|
|
| 106 |
|
| 107 |
|
| 108 |
def features_to_gallery(features):
|
| 109 |
-
indices = annoy_index.get_nns_by_vector(features, n=
|
| 110 |
-
indices = drop_same_folder(indices)[:
|
| 111 |
top_urls = urls[indices]
|
| 112 |
return top_urls.tolist(), indices
|
| 113 |
|
|
@@ -167,7 +167,7 @@ with gr.Blocks(css="footer {visibility: hidden}") as demo:
|
|
| 167 |
query_uploaded_image_button = gr.Button("Show similiar to uploaded")
|
| 168 |
|
| 169 |
gallery = gr.Gallery(label="Images", show_label=False, elem_id="gallery"
|
| 170 |
-
).style(columns=
|
| 171 |
|
| 172 |
with gr.Row():
|
| 173 |
filename_textbox = gr.Textbox("", show_label=False).style(container=False)
|
|
|
|
| 106 |
|
| 107 |
|
| 108 |
def features_to_gallery(features):
|
| 109 |
+
indices = annoy_index.get_nns_by_vector(features, n=500)
|
| 110 |
+
indices = drop_same_folder(indices)[:50]
|
| 111 |
top_urls = urls[indices]
|
| 112 |
return top_urls.tolist(), indices
|
| 113 |
|
|
|
|
| 167 |
query_uploaded_image_button = gr.Button("Show similiar to uploaded")
|
| 168 |
|
| 169 |
gallery = gr.Gallery(label="Images", show_label=False, elem_id="gallery"
|
| 170 |
+
).style(columns=5, container=False)
|
| 171 |
|
| 172 |
with gr.Row():
|
| 173 |
filename_textbox = gr.Textbox("", show_label=False).style(container=False)
|