dataeval.core.TrackStatsResult¶
- class dataeval.core.TrackStatsResult¶
Compute per-track statistics for one video sequence.
- track_ids¶
Sorted list of track IDs present in the input.
track_ids[i]gives the track ID whose stats are at index i in every other sequence field.
- labels¶
Representative class label for each track, taken as the most frequent per-frame label. A track should be single-class in practice, but the raw per-frame labels may disagree; this reports the majority label so each track has exactly one class for downstream analysis.
- label_confidence¶
Confidence in each track’s assigned
labelsentry: the assigned label’s share of total detection score across the track’s observations,sum(scores[labels == label]) / sum(scores). 1.0 for a single-class track; lower when observations disagree. With uniform scores (e.g. ground truth) this is the fraction of frames carrying the label — a purity / label-consistency signal.
- mean_score¶
Mean detection confidence over the track’s observations. 1.0 for ground-truth tracks whose scores are all 1.0. NaN when scores are absent.
- n_appearances¶
Number of frames in which the track ID appears. A track present in every frame of a 300-frame video has
n_appearances = 300; a track present only in the first and last frames hasn_appearances = 2.
- track_duration¶
Total number of frames between a track’s first and last appearance, inclusive. Equal to
n_appearancesfor contiguous tracks; greater thann_appearanceswhen gaps are present. A track present only in the first and last frames of a 300-frame video hastrack_duration = 300.
- n_gaps¶
Number of contiguous gap runs between a track’s first and last appearance. Zero for fully contiguous tracks.
- total_gap_length¶
Total number of frames between a track’s first and last appearance where the track ID is absent. Equal to
track_duration - n_appearances.
- mean_speed¶
Mean per-frame displacement of the bounding-box center in pixels, computed over consecutive observed frame pairs and normalised by the inter-frame delta so gaps do not inflate the estimate.
- speed_variance¶
Variance of per-frame center displacement across consecutive observed frame pairs. Zero for single-observation tracks.
- net_displacement¶
Euclidean distance in pixels between the box center at the first and last observation, regardless of the path taken.
- straightness_index¶
Ratio of net displacement to total path length (sum of per-step Euclidean distances between consecutive observed centers). Ranges from 0 (maximally tortuous / looping) to 1 (perfectly straight). NaN for single-observation tracks or perfectly stationary tracks (zero path length).
- jitter_rate¶
Smoothness of the track’s speed profile, computed using SPARC (SPectral ARC length). Unlike the reference paper, the result is not negated, so higher = more jittery. NaN for tracks shorter than
jitter_min_frames(default 10). Presented as a rate per track length.
- entry_at_edge¶
True when the track’s first bounding box touches or crosses the frame border (within
edge_thresholdpixels on any side). Always False ifframe_width/frame_heightwere not provided.
- exit_at_edge¶
True when the track’s last bounding box touches or crosses the frame border (within
edge_thresholdpixels on any side). Always False ifframe_width/frame_heightwere not provided.
Notes
1. Every sequence field is indexed by position in sorted track ID order, not by track ID directly. Use
track_ids[i]to recover the original track ID for position i.References
Balasubramanian, S., Melendez-Calderon, A., & Burdet, E. (2012). A robust and sensitive metric for quantifying movement smoothness. IEEE Transactions on Biomedical Engineering, 59(8), 2126-2136.
Batschelet, E. (1981). Circular Statistics in Biology. Academic Press.
Benhamou, S. (2004). How to reliably estimate the tortuosity of an animal’s path: straightness, sinuosity, or fractal dimension? Journal of Theoretical Biology, 229(2), 209-220.