Public Member Functions | |
def | __init__ |
def | distance |
def | partial_fit |
Public Attributes | |
budget | |
matching_threshold | |
samples | |
Private Attributes | |
_metric |
A nearest neighbor distance metric that, for each target, returns the closest distance to any sample that has been observed so far. Parameters ---------- metric : str Either "euclidean" or "cosine". matching_threshold: float The matching threshold. Samples with larger distance are considered an invalid match. budget : Optional[int] If not None, fix samples per class to at most this number. Removes the oldest samples when the budget is reached. Attributes ---------- samples : Dict[int -> List[ndarray]] A dictionary that maps from target identities to the list of samples that have been observed so far.
Definition at line 99 of file nn_matching.py.
def deep_sort.nn_matching.NearestNeighborDistanceMetric.__init__ | ( | self, | |
metric, | |||
matching_threshold, | |||
budget = None |
|||
) |
Definition at line 123 of file nn_matching.py.
def deep_sort.nn_matching.NearestNeighborDistanceMetric.distance | ( | self, | |
features, | |||
targets | |||
) |
Compute distance between features and targets. Parameters ---------- features : ndarray An NxM matrix of N features of dimensionality M. targets : List[int] A list of targets to match the given `features` against. Returns ------- ndarray Returns a cost matrix of shape len(targets), len(features), where element (i, j) contains the closest squared distance between `targets[i]` and `features[j]`.
Definition at line 156 of file nn_matching.py.
def deep_sort.nn_matching.NearestNeighborDistanceMetric.partial_fit | ( | self, | |
features, | |||
targets, | |||
active_targets | |||
) |
Update the distance metric with new data. Parameters ---------- features : ndarray An NxM matrix of N features of dimensionality M. targets : ndarray An integer array of associated target identities. active_targets : List[int] A list of targets that are currently present in the scene.
Definition at line 137 of file nn_matching.py.
Definition at line 123 of file nn_matching.py.
Definition at line 123 of file nn_matching.py.
Definition at line 123 of file nn_matching.py.
Definition at line 123 of file nn_matching.py.