Closed whu-lyh closed 6 months ago
Thanks for your codes @ramdrop . I noticed some manner in common.py, when doing the knn search. The corresponding code is as followings:
def cal_recall_feat(gt, qFeat, dbFeat): # --------------------------------- use faiss to do NN search -------------------------------- # # faiss_index = faiss.IndexFlatL2(qFeat.shape[1]) # faiss_index.add(dbFeat) # dists, predictions = faiss_index.search(qFeat, 20) # the results is sorted # -------------------------------- use sklearn to do NN search ------------------------------- # knn = NearestNeighbors(n_jobs=1) knn.fit(dbFeat) dists, predictions = knn.kneighbors(qFeat, 20) recalls = cal_recall_pred(gt, predictions) return recalls, dists, predictions
Can you share me some advice about how to use them? Thanks!
I figure it out..
Thanks for your codes @ramdrop . I noticed some manner in common.py, when doing the knn search. The corresponding code is as followings:
Can you share me some advice about how to use them? Thanks!