Descriptors
Descriptors
Descriptors(client: Connector = None, response: dict = None, type: str = None, spec: Query = None)
Bases: Entities
Python wrapper for ApertureDB Descriptors API.
find_similar
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.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
set | str | Descriptor set name. | required |
vector | list | Input descriptor vector. | required |
k_neighbors | int | Number of neighbors to return. | required |
constraints | Constraints | Constraints for the search. Defaults to None. | None |
distances | bool | Return similarity metric values. Defaults to False. | False |
blobs | bool | Return vectors of the neighbors. Defaults to False. | False |
results | dict | Dictionary with the results format. Defaults to | {'all_properties': True} |
Returns:
| Name | Type | Description |
|---|---|---|
None | Populates self.response with the parsed JSON response from the database. |
find_similar_mmr
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.
Args:
set (str): Descriptor set name.
vector (list): Input descriptor 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.