Warlord-K commited on
Commit
6658aa7
1 Parent(s): 26a3c21

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
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+=source_imgs[i].split("/")[-1].split(".")[0]
35
- names+= ","
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.jpeg"),
44
- os.path.join(os.path.dirname(__file__), "examples/group2.jpeg")
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