ANNIndex_create
import { ANNIndex_create } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
ARGUMENTSdim, distType
FUNCTIONANNIndex_create
RETURN TYPEANNIndex | null
Creates an instance of annoy index class with given parameters
ANNIndex_create(dim: number, distType: number): ANNIndex | null;2 available overloads
ANNIndex_create(dim: number): ANNIndex | null;ANNIndex_create(dim: number, distType: number): ANNIndex | null;dimThe dimension of the feature vector.
distTypeMetric to calculate the distance between two feature vectors, can be DIST_EUCLIDEAN, DIST_MANHATTAN, DIST_ANGULAR, DIST_HAMMING, or DIST_DOTPRODUCT.
Returns
The ANNIndex | null result.
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.