RobotJelly commited on
Commit
2619d84
1 Parent(s): f402651
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -74,8 +74,8 @@ emb_filename = 'unsplash-25k-photos-embeddings.pkl'
74
  with open(emb_filename, 'rb') as fIn:
75
  img_names, img_emb = pickle.load(fIn)
76
 
77
- def display_matches(indices):
78
- best_matched_images = [Image.open(IMAGES_DIR / img_names[top_k_best_image]) for top_k_best_image in torch.topk(similarity, 2, 0).indices]
79
  return best_matched_images
80
 
81
  def image_search(search_text, search_image, option):
 
74
  with open(emb_filename, 'rb') as fIn:
75
  img_names, img_emb = pickle.load(fIn)
76
 
77
+ def display_matches(similarity):
78
+ best_matched_images = [Image.open(IMAGES_DIR / img_names[top_k_best_image]) for top_k_best_image in torch.topk(similarity, 4, 0).indices]
79
  return best_matched_images
80
 
81
  def image_search(search_text, search_image, option):