Skip to content

fix(fusion): bound moment components to shared overlapping interval (#87) - #141

Open
Muhammad-AbdullahGhani wants to merge 1 commit into
grayhatdevelopers:mainfrom
Muhammad-AbdullahGhani:fix/bounded-moment-components
Open

fix(fusion): bound moment components to shared overlapping interval (#87)#141
Muhammad-AbdullahGhani wants to merge 1 commit into
grayhatdevelopers:mainfrom
Muhammad-AbdullahGhani:fix/bounded-moment-components

Conversation

@Muhammad-AbdullahGhani

Copy link
Copy Markdown

Related issue

Closes #87

Summary

When grouping search hits into moments in _connected_components, VidXP previously combined hits whenever their time ranges touched or overlapped (hit.start <= current_end, with current_end = max(current_end, hit.end)). This transitive interval chaining caused a single bridging hit spanning two otherwise separate moments (e.g. A overlaps B and B overlaps C, but A and C are disjoint) to collapse into one broad moment.

This change bounds each moment component to hits that share a common overlapping interval (current_overlap_end = min(current_overlap_end, hit.end)). Nearby duplicate hits covering the same scene or action still combine, while disjoint moments bridged by a longer hit remain separate occurrences.

Validation

  • pytest tests/test_search_fusion.py -p no:asyncio (5 passed in 0.27s, including regression test test_bridging_hit_does_not_merge_separate_moments and test_nearby_duplicate_hits_combine_into_one_moment)
  • pytest tests/test_query_service.py tests/test_evidence_delivery.py -p no:asyncio (23 passed in 1.23s)
  • ruff check src/vidxp/search_fusion.py tests/test_search_fusion.py (All checks passed)
  • ruff format --check src/vidxp/search_fusion.py tests/test_search_fusion.py (2 files already formatted)

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.

Keep separate video moments from being merged together

2 participants