Fix multi-shot matching: Always use continuity seed for first island to prevent wrong scene jumps

This commit is contained in:
Melbar
2026-05-08 11:50:13 +02:00
parent 730b5ef3c0
commit 4fe1d35f1a
7 changed files with 7 additions and 631 deletions
+6 -15
View File
@@ -1471,21 +1471,12 @@ def _match_unmatched_visual_segments(
start_s=beat.start_s + start_s,
end_s=beat.start_s + end_s,
)
if island_idx == 0:
# First island of an unmatched multi-shot beat: search globally
# without a continuity bias from the previous beat. Continuity
# assumes the shot follows the previous beat in the source, but
# the lead shot of a multi-shot beat is often an insert cut from
# a completely different scene. A wrong seed with score 0.92
# would push the real match out of the refinement candidate pool.
continuity = {}
else:
continuity = _continuity_seed_in_points(
beat.beat_id,
[b if b.beat_id != beat.beat_id else segment_beat for b in beats],
cached + expanded,
cfg,
)
continuity = _continuity_seed_in_points(
beat.beat_id,
[b if b.beat_id != beat.beat_id else segment_beat for b in beats],
cached + expanded,
cfg,
)
segment_matches = []
if beat.beat_id not in skip_global_segment_scan_for:
segment_matches = _run_segment_match(segment_beat, continuity, cfg, allow_fullscan=True)