Spaces:
Runtime error
Runtime error
feat: set output to iamge
Browse files
app.py
CHANGED
@@ -36,16 +36,15 @@ def search_index(input_image, k: int):
|
|
36 |
_, I = index.search(np.array(embedding[0].reshape(1, -1)), k)
|
37 |
indices = I[0]
|
38 |
answer = ""
|
39 |
-
for i, index in enumerate(indices[:
|
40 |
-
|
41 |
-
|
42 |
-
return answer
|
43 |
|
44 |
|
45 |
app = gr.Interface(
|
46 |
search_index,
|
47 |
-
inputs=
|
48 |
-
outputs="
|
49 |
)
|
50 |
|
51 |
if __name__ == "__main__":
|
|
|
36 |
_, I = index.search(np.array(embedding[0].reshape(1, -1)), k)
|
37 |
indices = I[0]
|
38 |
answer = ""
|
39 |
+
for i, index in enumerate(indices[:1]):
|
40 |
+
retrieved_img = dataset["train"][int(index)]["image"]
|
41 |
+
return retrieved_img
|
|
|
42 |
|
43 |
|
44 |
app = gr.Interface(
|
45 |
search_index,
|
46 |
+
inputs=gr.Image(),
|
47 |
+
outputs="image",
|
48 |
)
|
49 |
|
50 |
if __name__ == "__main__":
|