CLEAR MOT Metrics
- class stonesoup.metricgenerator.clearmotmetrics.ClearMotMetrics(distance_measure: Measure, generator_name: str = 'clearmot_generator', tracks_key: str = 'tracks', truths_key: str = 'groundtruth_paths')[source]
Bases:
MetricGenerator
CLEAR MOT metrics
Computes multi-object tracking (MOT) metrics designed for the classification of events, activities, and relationships (CLEAR) evaluation workshops. The implementation here is derived from [1] and provides following metrics:
MOTP (precision): average distance between all associated truth and track states. The target score is 0.
MOTA (accuracy): 1 - ratio of the number of misses, false positives, and mismatches (ID-switches)relative to the total number of truth states. The target score is 1. This score can become negative with a higher number of errors.
- Reference:
[1] Evaluating Multiple Object Tracking Performance: The CLEAR MOT Metrics, Bernardin et al, 2008
- Parameters:
distance_measure (
Measure
) – Distance measure used in calculating the MOTP score.generator_name (
str
, optional) – Unique identifier to use when accessing generated metrics from MultiManagertracks_key (
str
, optional) – Key to access set of tracks added to MetricManagertruths_key (
str
, optional) – Key to access set of ground truths added to MetricManager. Or key to access a second set of tracks for track-to-track metric generation
- truths_key: str
Key to access set of ground truths added to MetricManager. Or key to access a second set of tracks for track-to-track metric generation
- compute_metric(manager: MultiManager, **kwargs) list[Metric] [source]
Compute MOTP and MOTA metrics for a given time-period covered by truths and the tracks.
- Parameters:
manager (MetricManager) – containing the data to be used to create the metric(s)
- Returns:
Generated metrics
- Return type:
list of
Metric
objects
- static truth_track_from_association(association) tuple[Track, Track] [source]
Find truth and track from an association.
- Parameters:
association (Association) – Association that contains truth and track as its objects
- Returns:
True object and track that are the objects of the association
- Return type:
- exception stonesoup.metricgenerator.clearmotmetrics.AssociationSetNotValid[source]
Bases:
Exception
- stonesoup.metricgenerator.clearmotmetrics.check_matches_for_metric_calculation(matches_by_timestamp: dict[datetime, set[tuple[str, str]]])[source]
Checks the matches prior to computing CLEAR MOT metrics. If this function returns without raising an exception, it is checked that a single track is associated with one truth (one-2-one relationship) at a given timestep and vice versa.
- Parameters:
matches_by_timestamp (Dict[datetime.datetime, MatchSetAtTimestamp]) – Dictionary which returns a set of (truth, track) matches for a given timestamp.
- Raises: