Skip to content

feat(map): add clean_keyframes.py to detect and prune non-discriminative keyframes - #212

Merged
dvorak0 merged 1 commit into
mainfrom
xiaolefang/clean_keyframes
Aug 1, 2026
Merged

feat(map): add clean_keyframes.py to detect and prune non-discriminative keyframes#212
dvorak0 merged 1 commit into
mainfrom
xiaolefang/clean_keyframes

Conversation

@xiaolefang-dm

@xiaolefang-dm xiaolefang-dm commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds tool/clean_keyframes.py: a single tool that queries a built map with an independent
    probe 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.
  • Also writes an HTML + images report explaining what was removed and why (per removed keyframe:
    its overall track record across the whole bag scan, plus worst-dispersion evidence queries).
  • Detection method matches what was previously validated (topk=5, cluster_radius=1.0m,
    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 at
    https://huggingface.co/datasets/UniflexAI/rosbag_tinynav_vlad_eval)
  • Draft: checking against additional maps before marking ready for review

Report example page

image

🤖 Generated with Claude Code

…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.
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
cloc github.com/AlDanial/cloc v 2.04 T=0.52 s (89.9 files/s, 262297.2 lines/s)
Language files blank comment code
JSON 3 8 0 129481
Python 15 742 357 4101
Markdown 4 155 6 426
C++ 4 60 38 409
CSS 1 58 0 342
Bourne Shell 15 41 9 272
Dockerfile 1 31 32 204
HTML 1 6 0 107
make 1 20 15 62
TOML 1 4 0 59
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 47 1129 457 135480

@xiaolefang-dm
xiaolefang-dm marked this pull request as ready for review August 1, 2026 15:19
@dvorak0
dvorak0 merged commit f99e6e6 into main Aug 1, 2026
5 of 6 checks passed
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.

2 participants