Skip to content

Comments

Fix inverted interpolation ratio in tracking evaluation#1192

Open
dhruvildarji wants to merge 1 commit intonutonomy:masterfrom
dhruvildarji:fix/tracking-interpolation
Open

Fix inverted interpolation ratio in tracking evaluation#1192
dhruvildarji wants to merge 1 commit intonutonomy:masterfrom
dhruvildarji:fix/tracking-interpolation

Conversation

@dhruvildarji
Copy link

Summary

  • Fixes the right_ratio calculation in interpolate_tracks() which was inverted, causing interpolated tracking boxes to be spatially closer to the wrong endpoint

Problem

In python-sdk/nuscenes/eval/tracking/loaders.py, the interpolation ratio was computed as:

right_ratio = float(right_timestamp - timestamp) / (right_timestamp - left_timestamp)

This measures the distance from the interpolated timestamp to the right timestamp, but uses it as the weight for the right box. The result is that when an interpolated timestamp is close to the right box temporally, right_ratio approaches 0, making the interpolated box spatially close to the left box instead.

Example: If timestamp == right_timestamp, then right_ratio = 0 and the interpolated box equals the left box -- clearly wrong.

Fix

Changed the numerator to (timestamp - left_timestamp):

right_ratio = float(timestamp - left_timestamp) / (right_timestamp - left_timestamp)

Now right_ratio correctly approaches 1.0 as the interpolated timestamp gets closer to the right box, and 0.0 when closer to the left box.

Test plan

  • Verify that right_ratio = 0 when timestamp == left_timestamp (interpolated box equals left box)
  • Verify that right_ratio = 1 when timestamp == right_timestamp (interpolated box equals right box)
  • Verify that right_ratio = 0.5 at the midpoint between left and right timestamps

Fixes #1141

The right_ratio was computed as (right_timestamp - timestamp) / (right - left),
which gives a higher weight to the right box when the interpolated timestamp is
farther from it. This is inverted: when timestamp is close to right_timestamp,
right_ratio should approach 1.0 (not 0.0) so the interpolated box is spatially
close to the right box.

Changed to (timestamp - left_timestamp) / (right - left) so the ratio correctly
increases as the interpolated timestamp approaches the right box.

Fixes nutonomy#1141

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Potential mistake in interpolation for tracking evaluation

1 participant