Spaces:
Build error
Build error
Commit ·
81b51c7
1
Parent(s): f889699
app.py
Browse files
app.py
CHANGED
|
@@ -121,23 +121,14 @@ def image_search(Option, topk, search_text, search_image):
|
|
| 121 |
similarity = util.cos_sim(img_emb, image_emb)
|
| 122 |
return display_matches(similarity, topk)
|
| 123 |
|
| 124 |
-
#gr.Interface(fn=image_search,
|
| 125 |
-
# inputs=[gr.inputs.Textbox(lines=7, label="Input Text"),
|
| 126 |
-
# gr.inputs.Image(optional=True),
|
| 127 |
-
# gr.inputs.Dropdown(["Text-To-Image", "Image-To-Image"])
|
| 128 |
-
# ],
|
| 129 |
-
# outputs=gr.outputs.Carousel([gr.outputs.Image(type="pil"), gr.outputs.Image(type="pil"), gr.outputs.Image(type="pil"), gr.outputs.Image(type="pil")]),
|
| 130 |
-
# enable_queue=True
|
| 131 |
-
# ).launch(debug=True,share=True)
|
| 132 |
gr.Interface(fn=image_search, title="Search Image",
|
| 133 |
description="Enter the text or image to search the other most relevant images...",
|
| 134 |
article="""
|
| 135 |
Instructions:-
|
| 136 |
1. Select the option - `Text to Image` OR `Image To Image`.
|
| 137 |
-
2.
|
| 138 |
-
3.
|
| 139 |
-
|
| 140 |
-
Note: on entering the text, it may first show a different/unexpected image but then after a sec. it will show the correct image.
|
| 141 |
""",
|
| 142 |
theme="huggingface",
|
| 143 |
inputs=[gr.inputs.Dropdown(["Text-To-Image", "Image-To-Image"]),
|
|
|
|
| 121 |
similarity = util.cos_sim(img_emb, image_emb)
|
| 122 |
return display_matches(similarity, topk)
|
| 123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
gr.Interface(fn=image_search, title="Search Image",
|
| 125 |
description="Enter the text or image to search the other most relevant images...",
|
| 126 |
article="""
|
| 127 |
Instructions:-
|
| 128 |
1. Select the option - `Text to Image` OR `Image To Image`.
|
| 129 |
+
2. Select the no. of most relevant images you want to see.
|
| 130 |
+
3. Then accordingly enter the text or image.
|
| 131 |
+
4. Then you will get the images on right. To enter another text/image first clear it then follow the steps 1-3.
|
|
|
|
| 132 |
""",
|
| 133 |
theme="huggingface",
|
| 134 |
inputs=[gr.inputs.Dropdown(["Text-To-Image", "Image-To-Image"]),
|