Skip to main content

DescriptorSetDataCSV

DescriptorSetDataCSV​

DescriptorSetDataCSV(filename: str, **kwargs)

Bases: CSVParser

ApertureDB DescriptorSet Data.

This class loads the Descriptor Set Data which is present in a CSV file, and converts it into a series of aperturedb queries.

Note

Is backed by a CSV file with the following columns:

name, dimensions, engine, metric, PROP_NAME_N, constraint_PROP1

Example CSV file::

name,dimensions,engine,metric
dining_chairs,2048,IVF,L2
chandeliers,2048,IVF,L2
console_tables,2048,IVF,L2
...

The engine column holds an engine name or a list of names, sent as the engines configuration object with default settings for each engine. To configure engine settings, the third column can instead be engines, holding that JSON object, for example "{""hnsw"": {""M"": 16}}".

Example code to create an instance:


data = DescriptorSetDataCSV("/path/to/DescriptorSetData.csv")
loader = ParallelLoader(client)
loader.ingest(data)

Info

In the above example, the first row implies to create a Descriptor set called dining_chairs. The Descriptors in that set would be expected to be an array of float64, of length 2048. When performing a search on this set, IVF engine would be used and the metric to compute the distance would be L2.