Skip to content

[ITEP-89467] Tracking Evaluation Pipeline: Add jitter metrics (RMS jerk and acceleration variance)#1293

Merged
dmytroye merged 50 commits intomainfrom
ITEP-89467/add-jitter-metrics
Apr 10, 2026
Merged

[ITEP-89467] Tracking Evaluation Pipeline: Add jitter metrics (RMS jerk and acceleration variance)#1293
dmytroye merged 50 commits intomainfrom
ITEP-89467/add-jitter-metrics

Conversation

@dmytroye
Copy link
Copy Markdown
Member

@dmytroye dmytroye commented Apr 8, 2026

📝 Description

Adds a new tracking-evaluation “jitter” evaluator to compute smoothness metrics (RMS jerk and acceleration variance) and wires it into the evaluation pipeline.

Changes:

  • Introduces JitterEvaluator with RMS jerk and acceleration variance computations based on numerical differentiation.
  • Adds unit tests for configuration, processing, metric computation, and result-file output.
  • Updates pipeline configs and docs to include/describe the new evaluator.

Metrics:

Metric Source Description
rms_jerk Tracker output RMS jerk across all tracker output tracks (m/s³)
acceleration_variance Tracker output Variance of acceleration magnitudes across all tracker output tracks (m/s²)²
rms_jerk_gt Ground truth Same as rms_jerk computed on ground-truth tracks
acceleration_variance_gt Ground truth Same as acceleration_variance computed on ground-truth tracks
rms_jerk_ratio Tracker / GT rms_jerk / rms_jerk_gt — tracker jitter relative to GT (1.0 = equal)
acceleration_variance_ratio Tracker / GT acceleration_variance / acceleration_variance_gt

Comparing rms_jerk with rms_jerk_gt shows how much jitter the tracker
adds on top of any jitter already present in the test data.

Algorithm:

All metrics are derived by applying three sequential layers of forward finite differences to 3D positions, accounting for variable time steps between frames:

$$v_i = \frac{p_{i+1} - p_i}{\Delta t_i}, \quad a_i = \frac{v_{i+1} - v_i}{\Delta t_{v,i}}, \quad j_i = \frac{a_{i+1} - a_i}{\Delta t_{a,i}}$$

  • rms_jerk / rms_jerk_gt: $\sqrt{\frac{1}{N}\sum |j_i|^2}$ over all jerk samples from all tracks.
  • acceleration_variance / acceleration_variance_gt: $\text{Var}(|a_i|)$ over all acceleration magnitude samples from all tracks.
  • rms_jerk_ratio / acceleration_variance_ratio: tracker metric divided by the corresponding GT metric. Returns 0.0 when the GT denominator is zero. Values >1.0 indicate the tracker adds more jitter than is inherent in the ground truth.

Minimum track length: 3 points for acceleration, 4 points for jerk. Shorter tracks are skipped; if no eligible tracks exist, the metric returns 0.0.

For GT metrics, ground-truth frame numbers are converted to relative timestamps using the FPS derived from the tracker output.

Key Features:

  • Builds per-track position histories from canonical tracker output format.
  • Parses MOTChallenge 3D CSV ground-truth file for GT metric computation.
  • Supports variable frame rates — time deltas are computed from actual timestamps.
  • Deduplicates frames with identical timestamps (mirrors TrackEvalEvaluator behaviour).
  • Sorts each track's positions by timestamp before metric computation.
  • Saves a plain-text jitter_results.txt summary to the configured output folder.

✨ Type of Change

Select the type of change your PR introduces:

  • 🐞 Bug fix – Non-breaking change which fixes an issue
  • 🚀 New feature – Non-breaking change which adds functionality
  • 🔨 Refactor – Non-breaking change which refactors the code base
  • 💥 Breaking change – Changes that break existing functionality
  • 📚 Documentation update
  • 🔒 Security update
  • 🧪 Tests
  • 🚂 CI

🧪 Testing Scenarios

Describe how the changes were tested and how reviewers can test them too:

Unit tests (no Docker required):

cd tools/tracker/evaluation
source .venv/bin/activate
pip install -r requirements.txt
pytest evaluators/tests/test_jitter_evaluator.py -v

Full unit test suite (verify no regressions):

pytest . -v -m "not integration"

End-to-end pipeline run (requires Docker + scenescape-controller image):

python pipeline_engine.py pipeline_configs/controller_evaluation.yaml
  • ✅ Tested manually
  • 🤖 Ran automated end-to-end tests

✅ Checklist

Before submitting the PR, ensure the following:

  • 🔍 PR title is clear and descriptive
  • 📝 For internal contributors: If applicable, include the JIRA ticket number (e.g., ITEP-123456) in the PR title. Do not include full URLs
  • 💬 I have commented my code, especially in hard-to-understand areas
  • 📄 I have made corresponding changes to the documentation
  • ✅ I have added tests that prove my fix is effective or my feature works

dmytroye and others added 14 commits April 8, 2026 12:41
- Replace single _evaluator with _evaluators list
- Remove single-evaluator restriction in _validate_configuration
- Instantiate and configure all evaluators in load_configuration
- evaluate() runs all evaluators and returns Dict[str, Dict[str, float]]
  keyed by evaluator class name
- Update pipeline config to list both evaluators
- Update tests: _evaluator -> _evaluators, multi-evaluator test now
  expects success, evaluate() result shape updated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@dmytroye dmytroye self-assigned this Apr 8, 2026
@dmytroye dmytroye requested a review from Copilot April 9, 2026 08:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new tracking-evaluation “jitter” evaluator to compute smoothness metrics (RMS jerk and acceleration variance) and wires it into the evaluation pipeline.

Changes:

  • Introduces JitterEvaluator with RMS jerk and acceleration variance computations based on numerical differentiation.
  • Adds unit tests for configuration, processing, metric computation, and result-file output.
  • Updates pipeline configs and docs to include/describe the new evaluator.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
tools/tracker/evaluation/pipeline_configs/metric_test_evaluation.yaml Adds JitterEvaluator to the metric test pipeline config.
tools/tracker/evaluation/evaluators/jitter_evaluator.py Implements jitter metric processing, computation, and result persistence.
tools/tracker/evaluation/evaluators/tests/test_jitter_evaluator.py Adds unit tests covering JitterEvaluator behavior.
tools/tracker/evaluation/evaluators/init.py Exposes JitterEvaluator from the evaluators package.
tools/tracker/evaluation/evaluators/README.md Documents JitterEvaluator usage, metrics, and algorithm.
tools/tracker/evaluation/README.md Documents pipeline configuration and lists JitterEvaluator as available.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

@dmytroye dmytroye changed the title [WIP] [ITEP-89467] Tracking Evaluation Pipeline: Add jitter metrics (RMS jerk and acceleration variance) [ITEP-89467] Tracking Evaluation Pipeline: Add jitter metrics (RMS jerk and acceleration variance) Apr 9, 2026
@dmytroye dmytroye marked this pull request as ready for review April 9, 2026 10:05
@dmytroye dmytroye requested a review from tdorauintc April 9, 2026 10:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Copy link
Copy Markdown
Contributor

@tdorauintc tdorauintc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor comments added.

Please update evaluators in the Agents.md

Base automatically changed from ITEP-89828/multiple-evaluators-support to main April 10, 2026 12:52
@dmytroye dmytroye enabled auto-merge (squash) April 10, 2026 15:39
@dmytroye dmytroye merged commit 1452979 into main Apr 10, 2026
30 checks passed
@dmytroye dmytroye deleted the ITEP-89467/add-jitter-metrics branch April 10, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants