SmilingWolf
commited on
Commit
•
213351b
1
Parent(s):
1b8725e
Fix outdated code
Browse files
app.py
CHANGED
@@ -19,6 +19,8 @@ DESCRIPTION = """
|
|
19 |
Image similarity-based retrieval tool using:
|
20 |
- [SmilingWolf/wd-v1-4-convnext-tagger-v2](https://huggingface.co/SmilingWolf/wd-v1-4-convnext-tagger-v2) as feature extractor
|
21 |
- [Faiss](https://github.com/facebookresearch/faiss) and [autofaiss](https://github.com/criteo/autofaiss) for indexing
|
|
|
|
|
22 |
"""
|
23 |
|
24 |
HF_TOKEN = os.environ["HF_TOKEN"]
|
@@ -183,12 +185,15 @@ def main():
|
|
183 |
visible=False,
|
184 |
)
|
185 |
n_neighbours = gr.Slider(
|
186 |
-
minimum=1,
|
|
|
|
|
|
|
|
|
187 |
)
|
188 |
find_btn = gr.Button("Find similar images")
|
189 |
-
similar_images = gr.Gallery(label="Similar images")
|
190 |
|
191 |
-
similar_images.style(grid=5)
|
192 |
find_btn.click(
|
193 |
fn=searcher.predict,
|
194 |
inputs=[
|
|
|
19 |
Image similarity-based retrieval tool using:
|
20 |
- [SmilingWolf/wd-v1-4-convnext-tagger-v2](https://huggingface.co/SmilingWolf/wd-v1-4-convnext-tagger-v2) as feature extractor
|
21 |
- [Faiss](https://github.com/facebookresearch/faiss) and [autofaiss](https://github.com/criteo/autofaiss) for indexing
|
22 |
+
|
23 |
+
Also, check out [SmilingWolf/danbooru2022_embeddings_playground](https://huggingface.co/spaces/SmilingWolf/danbooru2022_embeddings_playground) for a similar space with experimental support for text input combined with image input.
|
24 |
"""
|
25 |
|
26 |
HF_TOKEN = os.environ["HF_TOKEN"]
|
|
|
185 |
visible=False,
|
186 |
)
|
187 |
n_neighbours = gr.Slider(
|
188 |
+
minimum=1,
|
189 |
+
maximum=20,
|
190 |
+
value=5,
|
191 |
+
step=1,
|
192 |
+
label="# of images",
|
193 |
)
|
194 |
find_btn = gr.Button("Find similar images")
|
195 |
+
similar_images = gr.Gallery(label="Similar images", columns=[5])
|
196 |
|
|
|
197 |
find_btn.click(
|
198 |
fn=searcher.predict,
|
199 |
inputs=[
|