zswwsz commited on
Commit
e9cf9c7
1 Parent(s): 02af94d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -35,6 +35,8 @@ def preprocess(temp):
35
  def match_img(txt_vec):
36
  sim_matrix = []
37
  for vec in img_vec:
 
 
38
  sim = cosine_similarity(txt_vec, vec)
39
  sim_matrix.append(sim)
40
  img_idx = np.argmax(sim_matrix)
 
35
  def match_img(txt_vec):
36
  sim_matrix = []
37
  for vec in img_vec:
38
+ vec = vec.reshape(-1, 1)
39
+ txt_vec = txt_vec.reshape(-1, 1)
40
  sim = cosine_similarity(txt_vec, vec)
41
  sim_matrix.append(sim)
42
  img_idx = np.argmax(sim_matrix)