sample_id.ann.hive module

class sample_id.ann.hive.HiveMatcher(matchers)[source]

Bases: sample_id.ann.ann.Matcher

A wrapper around a list of Matchers so that they act like a single Matcher (for inference only).

add_fingerprint(fingerprint, dedupe=True)[source]

Add a Fingerprint to the matcher.

Return type

Matcher

add_fingerprints(fingerprints, **kwargs)[source]

Add Fingerprints to the matcher.

Return type

Matcher

add_matcher(matcher)[source]
Return type

HiveMatcher

can_add_fingerprint(fingerprint)[source]

Check if fingerprint can be added to matcher.

Return type

bool

classmethod create(sr=None, hop_length=None, **kwargs)[source]

Create an instance, pass any kwargs needed by the subclass.

Return type

Matcher

classmethod from_fingerprint(fp, **kwargs)[source]

Useful for determining metadata for the Matcher based on the data being added.

Return type

Matcher

classmethod from_fingerprints(fingerprints, **kwargs)[source]

My data is small, just create and train the entire matcher.

Return type

Matcher

init_model()[source]

Initialize the model.

Return type

Any

classmethod load(filepaths, **kwargs)[source]

Load multiple matchers from disk into hive.

Return type

Matcher

load_model(filepath, **kwargs)[source]

Load this matcher’s model from disk.

Return type

Any

nearest_neighbors(fp, k=1)[source]

Fetch nearest neighbors to this fingerprint’s keypoints.

Return type

Sequence[Match]

save(filepath, compress=True, **kwargs)[source]

Save this matcher to disk.

Return type

str

save_model(filepath, **kwargs)[source]

Save this matcher’s model to disk.

Return type

str