Fix inverted interpolation ratio in tracking evaluation#1192
Open
dhruvildarji wants to merge 1 commit intonutonomy:masterfrom
Open
Fix inverted interpolation ratio in tracking evaluation#1192dhruvildarji wants to merge 1 commit intonutonomy:masterfrom
dhruvildarji wants to merge 1 commit intonutonomy:masterfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
right_ratiocalculation ininterpolate_tracks()which was inverted, causing interpolated tracking boxes to be spatially closer to the wrong endpointProblem
In
python-sdk/nuscenes/eval/tracking/loaders.py, the interpolation ratio was computed as: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_ratioapproaches 0, making the interpolated box spatially close to the left box instead.Example: If
timestamp == right_timestamp, thenright_ratio = 0and the interpolated box equals the left box -- clearly wrong.Fix
Changed the numerator to
(timestamp - left_timestamp):Now
right_ratiocorrectly approaches 1.0 as the interpolated timestamp gets closer to the right box, and 0.0 when closer to the left box.Test plan
right_ratio = 0whentimestamp == left_timestamp(interpolated box equals left box)right_ratio = 1whentimestamp == right_timestamp(interpolated box equals right box)right_ratio = 0.5at the midpoint between left and right timestampsFixes #1141