Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
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 |
|