Examples
This section provides details on how to call the KScaNN algorithm API in Python. In the example, the sift-128-euclidean.hdf5 dataset is used.
Obtaining Test Code
Obtain the test framework code from the source code obtained in 3. Assume that the source code is stored in /path/to/scann/sra_scann_adapter and the test framework code is stored in /path/to/scann/sra_scann_adapter/ann-benchmarks. Obtain datasets.
1 2 3 | cd /path/to/scann/sra_scann_adapter/ann-benchmarks mkdir data && cd data wget http://ann-benchmarks.com/sift-128-euclidean.hdf5 --no-check-certificate |
The directory structure of the main files is as follows:
1 2 3 4 5 6 7 | ├── data // Stores the datasets. └── sift-128-euclidean.hdf5 ├── ann_benchmarks └── algorithms └── scann └── config-sift-128-euclidean.yml // Dataset configuration file. └── test.sh // Script for running the test. |
Procedure
- Check that scann-1.2.10-cp39-cp39-linux_aarch64.whl has been installed in 12.
- Install the dependencies required by ann-benchmarks.
1 2 3
cd /path/to/scann/sra_scann_adapter/ann-benchmarks pip install -r requirements.txt yum install numactl numactl-devel
- Run the test script.
1sh test.sh
The execution result is as follows:

Parent topic: Python APIs