Skip to content

Question about faiss searching #8

@whu-lyh

Description

@whu-lyh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions