mirror of
https://github.com/facebookresearch/faiss.git
synced 2025-06-03 21:54:02 +08:00
Summary: Code + scripts for Faiss benchmarks around the Fast scan codes. Pull Request resolved: https://github.com/facebookresearch/faiss/pull/1555 Test Plan: buck test //faiss/tests/:test_refine Reviewed By: wickedfoo Differential Revision: D25546505 Pulled By: mdouze fbshipit-source-id: 902486b7f47e36221a2671d124df8c114f25db58
28 lines
742 B
Python
28 lines
742 B
Python
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
#
|
|
# This source code is licensed under the MIT license found in the
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
import logging
|
|
|
|
# https://stackoverflow.com/questions/7016056/python-logging-not-outputting-anything
|
|
logging.basicConfig()
|
|
logger = logging.getLogger('faiss.contrib.exhaustive_search')
|
|
logger.setLevel(logging.INFO)
|
|
|
|
from faiss.contrib import datasets
|
|
from faiss.contrib.exhaustive_search import knn_ground_truth
|
|
from faiss.contrib import vecs_io
|
|
|
|
ds = datasets.DatasetDeep1B(nb=int(1e9))
|
|
|
|
print("computing GT matches for", ds)
|
|
|
|
D, I = knn_ground_truth(
|
|
ds.get_queries(),
|
|
ds.database_iterator(bs=65536),
|
|
k=100
|
|
)
|
|
|
|
vecs_io.ivecs_write("/tmp/tt.ivecs", I)
|