RobotJelly commited on
Commit
163d9e4
·
1 Parent(s): ad44212
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -90,7 +90,7 @@ def image_search(search_text, search_image, option):
90
 
91
  # Find the matched Images
92
  #matched_images = find_matches(text_features, photo_features, photo_ids, 4)
93
- matched_results = util.semantic_search(text_emb, img_emb, 4)[0]
94
 
95
  # top 4 highest ranked images
96
  return display_matches(matched_results)
@@ -106,7 +106,7 @@ def image_search(search_text, search_image, option):
106
  # Find the matched Images
107
  #matched_images = find_matches(image_feature, photo_ids, 4)
108
 
109
- image_emb = model.encode(Image.open(search_image), convert_to_tensor=True)
110
 
111
  # Find the matched Images
112
  #matched_images = find_matches(text_features, photo_features, photo_ids, 4)
 
90
 
91
  # Find the matched Images
92
  #matched_images = find_matches(text_features, photo_features, photo_ids, 4)
93
+ matched_results = util.semantic_search(text_emb, img_emb, top_k=4)[0]
94
 
95
  # top 4 highest ranked images
96
  return display_matches(matched_results)
 
106
  # Find the matched Images
107
  #matched_images = find_matches(image_feature, photo_ids, 4)
108
 
109
+ image_emb = model.encode([Image.fromarray(search_image)], convert_to_tensor=True)
110
 
111
  # Find the matched Images
112
  #matched_images = find_matches(text_features, photo_features, photo_ids, 4)