Skip to content

Party/action highlight detection (saliency candidate source)#44

Open
nmbrthirteen wants to merge 3 commits into
feat/moment-detection-phase1from
feat/moment-detection-phase2
Open

Party/action highlight detection (saliency candidate source)#44
nmbrthirteen wants to merge 3 commits into
feat/moment-detection-phase1from
feat/moment-detection-phase2

Conversation

@nmbrthirteen

Copy link
Copy Markdown
Owner

Stacked on #43.

What

Auto-cut highlight clips from footage with no useful transcript (party videos, action). New podcli process --profile party|action picks moments by peak-picking a fused laughter+energy curve instead of reading the transcript.

How

  • backend/services/saliency.py — the fusion engine:
    • per-video robust-z normalization (median/MAD, never global) so different recordings compare fairly
    • weighted channel fusion, renormalized over available channels
    • numpy peak-pick with min-gap NMS (no scipy dep)
    • reaction dilation so a single-frame laugh isn't suppressed by a louder energy neighbor
    • reaction-first candidate generation — a detected laugh/cheer is a primary candidate, energy peaks fill the rest
    • 8s backward expansion to capture the setup before a laugh (the funny thing happens before people react)
    • quiet-point boundary snapping
  • profiles.py candidate source routes selection: saliency (party/action) vs llm (podcast). Wired into the process pipeline Step 3 and the --profile flag.
  • Saliency clips use the render-compatible dict shape, so they flow through the existing review + render fan-out.

Validated

  • Deterministic on clean input (identical output across runs).
  • Reactions detected and labeled with correct run-up windows; energy peaks supplement.
  • Found a real laugh in a synthetic multi-clip video and expanded backwards to the setup.
  • Full suite: 375 passed (+24 new saliency/event tests). Same 3 pre-existing test_ai_fallback env failures.

Honest caveats

  • Thresholds and channel weights are starting points — they need tuning on real party footage. A synthetic concat of podcast clips is not representative (nearly all speech, one faint chuckle).
  • This increment still runs transcription for party videos (the process Step 1 is mandatory). Skipping transcription for saliency profiles on long videos is a follow-up optimization.
  • TS-side profile threading (MCP/web UI) is not in this PR — CLI only for now.

See plans/moment-detection.md for the full design and phasing.

Auto-cut highlight clips from footage with no useful transcript (party videos,
action) by peak-picking a fused laughter+energy curve instead of reading the
transcript. Selected via 'podcli process --profile party|action'.

- saliency.py: per-video robust-z normalization (median/MAD, never global),
  weighted channel fusion, numpy peak-pick with min-gap NMS, reaction dilation
  so a brief laugh isn't drowned by a louder neighbor, reaction-first candidate
  generation, 8s backward expansion to capture the setup before a laugh, and
  quiet-point boundary snapping
- profiles drive it: 'saliency' candidate source (party/action) vs 'llm'
  (podcast) picks the selection path in the process pipeline
- deterministic on clean input; produces render-compatible clip dicts

Thresholds and channel weights are starting points to be tuned on real party
footage.
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a86b686a-3be4-47c0-aff1-b4f17766dc54

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/moment-detection-phase2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Register a detect_highlights task handler so the MCP/web backend can run party/
action highlight detection via the python-executor, not just the CLI. Verified
end to end through the stdin dispatch.
Add detect_highlights_pooled and accept video_paths in the detect_highlights
task: run detection over many videos, tag each clip with its source_file, and
rank globally reaction-first. Serves the 'best N moments across a folder of
party clips' use case. Verified across two clips via the backend dispatch.
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.

1 participant