Tighten cutter phase span validation

This commit is contained in:
Melbar
2026-05-08 14:56:44 +02:00
parent 10e27afc8d
commit acafe538b2
8 changed files with 52 additions and 13 deletions
+6 -3
View File
@@ -1330,7 +1330,10 @@ def estimate_usable_source_duration(
warmup_scores = [score for offset, score in scores if offset <= min(1.0, beat.duration_s * 0.35)]
baseline = max(warmup_scores) if warmup_scores else max(score for _, score in scores)
min_score = max(0.34, baseline * 0.48)
# Keep the usable span tied to the same action phase, not just the same room
# or actors. A loose cutoff hides "same scene, wrong moment" drift in long
# dialogue shots where the background remains highly correlated.
min_score = max(0.42, baseline * 0.62)
last_good = 0.0
bad_run = 0
@@ -1363,8 +1366,8 @@ def estimate_usable_source_duration(
if (
len(tail_scores) >= 3
and float(np.std(tail_scores)) < 0.025
and float(np.mean(tail_scores)) > 0.20
and baseline >= 0.30
and float(np.mean(tail_scores)) > max(0.30, baseline * 0.58)
and baseline >= 0.42
):
logger.debug(
'Beat %d: stable plateau detected at offset %.3fs '