Reset CLEAR continuity after unmatched frames - #5237
Open
FlorianPfaff wants to merge 2 commits into
Open
Conversation
Contributor
✅MegaLinter analysis: Success
Notices📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining See detailed reports in MegaLinter artifacts Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining
|
FlorianPfaff
marked this pull request as ready for review
August 7, 2026 17:59
FlorianPfaff
enabled auto-merge (squash)
August 7, 2026 17:59
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.

Bug
evaluate_clear(...)keeps two identity caches with different semantics:previous_idtracks the last historical match for identity-switch counting;previous_timestep_idshould only represent matches from the immediately preceding frame for CLEAR continuity assignment.The immediate-timestep cache was cleared after ordinary matched frames, but not when a frame had no ground-truth detections or no tracker detections. A match from two or more frames ago could therefore receive the
+1000continuity bonus after a gap and override the current similarity-optimal assignment.In the regression sequence, two tracks are matched diagonally, missed for one frame, and then have stronger crossed similarities. Current
mainincorrectly preserves the stale diagonal assignment, reports zero identity switches, and accumulatesmotp_sum=3.2. The correct post-gap assignment is crossed, with two historical identity switches andmotp_sum=3.8.Fix
Clear
previous_timestep_idbefore returning early from either empty-side frame branch. The historicalprevious_idcache remains unchanged, so identity switches after a gap are still counted correctly.Regression coverage
Add
test_clear_continuity_does_not_cross_unmatched_frames, which verifies:3.8, proving the post-gap Hungarian assignment follows current similarities rather than stale continuity.Validation
(tp, fp, fn, switches, motp_sum) = (4, 0, 2, 0, 3.2);(4, 0, 2, 2, 3.8);main;GitHub Actions provides the authoritative full test, lint, packaging, documentation, and integration validation.