Commit 4ab16ab4 authored by 赵威's avatar 赵威

update index type

parent c5eef346
......@@ -69,10 +69,10 @@ def save_faiss_index(load_file, save_path):
features_np = np.array(features).astype("int")
print(ids_np)
print(features_np)
index = faiss.IndexHNSWFlat(128, 32)
index = faiss.IndexHNSW(128, 32)
print(index.is_trained)
index2 = faiss.IndexIDMap(index)
index2.add_with_ids(len(ids), features_np, ids_np)
index2.add_with_ids(features_np, ids_np)
faiss.write_index(index2, save_path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment