ubamba98 commited on
Commit
ffa6daf
·
1 Parent(s): e860724

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -32,8 +32,7 @@ def find_similar(image):
32
  similarities = list((search_photo_feature @ photo_features.T).squeeze(0))
33
 
34
  ## Return best image :)
35
- best_photo = sorted(zip(similarities, range(photo_features.shape[0])), key=lambda x: x[0], reverse=True)[0]
36
- idx = best_photos[1]
37
  photo_id = photo_ids[idx]
38
  photo_data = photos[photos["photo_id"] == photo_id].iloc[0]
39
 
 
32
  similarities = list((search_photo_feature @ photo_features.T).squeeze(0))
33
 
34
  ## Return best image :)
35
+ idx = sorted(zip(similarities, range(photo_features.shape[0])), key=lambda x: x[0], reverse=True)[0][1]
 
36
  photo_id = photo_ids[idx]
37
  photo_data = photos[photos["photo_id"] == photo_id].iloc[0]
38