modify Searcher to searcher

pull/1252/head
Bin Lu 2021-09-22 16:56:08 +08:00 committed by GitHub
parent 6f08fb25b4
commit ccda54d7cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ class RecogOp(Op):
assert os.path.exists(os.path.join(
index_dir, "id_map.pkl")), "id_map.pkl not found ... "
self.Searcher = faiss.read_index(
self.searcher = faiss.read_index(
os.path.join(index_dir, "vector.index"))
with open(os.path.join(index_dir, "id_map.pkl"), "rb") as fd:
@ -62,7 +62,7 @@ class RecogOp(Op):
score_list = fetch_dict["features"]
return_top_k = 1
scores, docs = self.Searcher.search(score_list, return_top_k)
scores, docs = self.searcher.search(score_list, return_top_k)
result = {}
result["label"] = self.id_map[docs[0][0]].split()[1]