feat(map): add clean_keyframes.py to detect and prune non-discriminative keyframes - #212
Merged
Conversation
…ive keyframes Queries a built map with an independent probe bag; keyframes whose top-K retrieval candidates repeatedly fail to spatially agree (perceptual aliasing rather than a genuine revisit) are pruned into a new map copy, alongside an HTML+images report explaining what was removed and why.
|
xiaolefang-dm
marked this pull request as ready for review
August 1, 2026 15:19
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
tool/clean_keyframes.py: a single tool that queries a built map with an independentprobe bag, flags map keyframes whose top-K retrieval candidates repeatedly fail to spatially
agree (perceptual aliasing rather than a genuine revisit), and prunes them into a new map copy.
its overall track record across the whole bag scan, plus worst-dispersion evidence queries).
dispersion_threshold=0.4, min_participation=3); a keyframe is removed if it was ever the
spatial outlier in a dispersed retrieval.
Test plan
tool/clean_keyframes.py --map_path tinynav_db/maps/map_gt --bag_path tinynav_db/rosbags/bag_1970_01_01_08_05_15:486 queries, 16 dispersed, 28 keyframes removed (1120 -> 1092); report images + HTML verified correct
(
map_gt+ the night probe bag are both available athttps://huggingface.co/datasets/UniflexAI/rosbag_tinynav_vlad_eval)
Report example page
🤖 Generated with Claude Code