autoplace icon indicating copy to clipboard operation
autoplace copied to clipboard

Question about faiss searching

Open whu-lyh opened this issue 1 year ago • 1 comments

Hi @ramdrop , thanks for your amazing works and the release of the code. I find some positions that quite confuse me, and looking forward to your answer.

  1. here, why the number of search is len(dbFeat), in my opinion, the n_values should be used?
    faiss_index = faiss.IndexFlatL2(opt.output_dim)
    faiss_index.add(dbFeat)
    # dists, predictions = faiss_index.search(qFeat, max(n_values))   # the results is sorted
    dists, predictions = faiss_index.search(qFeat, len(dbFeat))
  1. I wonder why the radius dramatically change the PR performance during getting the GT?
def getPositives(self):
        # positives for evaluation are those within trivial threshold range
        # fit NN to find them, search by radius
        if self.positives is None:
            knn = NearestNeighbors(n_jobs=-1)
            knn.fit(self.dbStruct.utmDb)
            self.distances, self.positives = knn.radius_neighbors(self.dbStruct.utmQ, radius=self.dbStruct.nonTrivPosDistSqThr**0.5) 
        return self.positives

whu-lyh avatar Dec 07 '23 10:12 whu-lyh

Oops, I figured out the question1.

whu-lyh avatar Dec 07 '23 14:12 whu-lyh