Public Member Functions | Public Attributes | Private Attributes | List of all members
deep_sort.nn_matching.NearestNeighborDistanceMetric Class Reference
Inheritance diagram for deep_sort.nn_matching.NearestNeighborDistanceMetric:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, metric, matching_threshold, budget=None)
 
def distance (self, features, targets)
 
def partial_fit (self, features, targets, active_targets)
 

Public Attributes

 budget
 
 matching_threshold
 
 samples
 
- Public Attributes inherited from object
pointer iv [2]
 

Private Attributes

 _metric
 

Detailed Description

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.

Constructor & Destructor Documentation

def deep_sort.nn_matching.NearestNeighborDistanceMetric.__init__ (   self,
  metric,
  matching_threshold,
  budget = None 
)

Definition at line 123 of file nn_matching.py.

Member Function Documentation

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.

Member Data Documentation

deep_sort.nn_matching.NearestNeighborDistanceMetric._metric
private

Definition at line 127 of file nn_matching.py.

deep_sort.nn_matching.NearestNeighborDistanceMetric.budget

Definition at line 134 of file nn_matching.py.

deep_sort.nn_matching.NearestNeighborDistanceMetric.matching_threshold

Definition at line 133 of file nn_matching.py.

deep_sort.nn_matching.NearestNeighborDistanceMetric.samples

Definition at line 135 of file nn_matching.py.


The documentation for this class was generated from the following file:


jsk_perception
Author(s): Manabu Saito, Ryohei Ueda
autogenerated on Mon May 3 2021 03:03:27