Skip to main content

Descriptors

Descriptors Objects

class Descriptors(Entities)

Python wrapper for ApertureDB Descriptors API.

find_similar

def find_similar(set: str,
vector,
k_neighbors: int,
constraints=None,
distances: bool = False,
blobs: bool = False,
results={"all_properties": True})

Find similar descriptor sets to the input descriptor set.

Arguments:

  • set str - Descriptor set name.
  • vector list - Input descriptor set vector.
  • k_neighbors int - Number of neighbors to return.
  • distances bool - Return similarity metric values.
  • blobs bool - Return vectors of the neighbors.
  • results dict - Dictionary with the results format. Defaults to all properties.

Returns:

  • results - Response from the server.

find_similar_mmr

def find_similar_mmr(set: str,
vector,
k_neighbors: int,
fetch_k: int,
lambda_mult: float = 0.5,
**kwargs)

As find_similar, but using the MMR algorithm to diversify the results.

Arguments:

  • set str - Descriptor set name.
  • vector list - Input descriptor set vector.
  • k_neighbors int - Number of results to return.
  • fetch_k int - Number of neighbors to fetch from the database.
  • lambda_mult float - Lambda multiplier for the MMR algorithm. Defaults to 0.5. 1.0 means no diversity.