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 descriptors to the input descriptor.
Arguments:
setstr - Descriptor set name.vectorlist - Input descriptor vector.k_neighborsint - Number of neighbors to return.constraintsaperturedb.Constraints.Constraints, optional - Constraints for the search. Defaults to None.distancesbool, optional - Return similarity metric values. Defaults to False.blobsbool, optional - Return vectors of the neighbors. Defaults to False.resultsdict, optional - Dictionary with the results format. Defaults to{"all_properties": True}.
Returns:
None- Populates self.response with the parsed JSON response from the database.
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:
setstr - Descriptor set name.vectorlist - Input descriptor vector.k_neighborsint - Number of results to return.fetch_kint - Number of neighbors to fetch from the database.lambda_multfloat - Lambda multiplier for the MMR algorithm. Defaults to 0.5. 1.0 means no diversity.