Spaces:
Running
Running
update faiss index
Browse files- app.py +2 -2
- images.json +0 -0
- xbgp-faiss-map.json +0 -0
app.py
CHANGED
|
@@ -22,7 +22,7 @@ def process_image(image):
|
|
| 22 |
# and then formatting the output (extracted features).
|
| 23 |
|
| 24 |
# Load the index
|
| 25 |
-
with open("
|
| 26 |
images = json.load(f)
|
| 27 |
|
| 28 |
# Convert to RGB if it isn't already
|
|
@@ -56,7 +56,7 @@ def process_image(image):
|
|
| 56 |
faiss.normalize_L2(vector)
|
| 57 |
|
| 58 |
# Read the index file and perform search of top 50 images
|
| 59 |
-
index = faiss.read_index("
|
| 60 |
distances, indices = index.search(vector, 50)
|
| 61 |
|
| 62 |
matches = []
|
|
|
|
| 22 |
# and then formatting the output (extracted features).
|
| 23 |
|
| 24 |
# Load the index
|
| 25 |
+
with open("xbgp-faiss-map.json", "r") as f:
|
| 26 |
images = json.load(f)
|
| 27 |
|
| 28 |
# Convert to RGB if it isn't already
|
|
|
|
| 56 |
faiss.normalize_L2(vector)
|
| 57 |
|
| 58 |
# Read the index file and perform search of top 50 images
|
| 59 |
+
index = faiss.read_index("xbgp-faiss.index")
|
| 60 |
distances, indices = index.search(vector, 50)
|
| 61 |
|
| 62 |
matches = []
|
images.json
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
xbgp-faiss-map.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|