Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -29,19 +29,18 @@ def find_names(image):
|
|
29 |
for j, t in enumerate(embeds):
|
30 |
d[i][j] = findCosineDistance(s, t)
|
31 |
ids = np.argmin(d, axis = 0)
|
32 |
-
names =
|
33 |
for i in ids:
|
34 |
-
names
|
35 |
-
|
36 |
-
return names
|
37 |
|
38 |
demo = gr.Interface(
|
39 |
find_names,
|
40 |
gr.Image(type="filepath"),
|
41 |
"text",
|
42 |
examples = [
|
43 |
-
os.path.join(os.path.dirname(__file__), "examples/group1.
|
44 |
-
os.path.join(os.path.dirname(__file__), "examples/group2.
|
45 |
]
|
46 |
)
|
47 |
|
|
|
29 |
for j, t in enumerate(embeds):
|
30 |
d[i][j] = findCosineDistance(s, t)
|
31 |
ids = np.argmin(d, axis = 0)
|
32 |
+
names = []
|
33 |
for i in ids:
|
34 |
+
names.append(source_imgs[i].split("/")[-1].split(".")[0])
|
35 |
+
return ",".join(names)
|
|
|
36 |
|
37 |
demo = gr.Interface(
|
38 |
find_names,
|
39 |
gr.Image(type="filepath"),
|
40 |
"text",
|
41 |
examples = [
|
42 |
+
os.path.join(os.path.dirname(__file__), "examples/group1.jpg"),
|
43 |
+
os.path.join(os.path.dirname(__file__), "examples/group2.jpg")
|
44 |
]
|
45 |
)
|
46 |
|