feat(digest): dedupe near-duplicate slide frames + configurable [frames] (frames-redesign PR-A)#74
Merged
Merged
Conversation
…es] (B/PR-A) First PR of the frames-layer redesign. The extractor kept up to 40 frames spread EVENLY across the video, with no dedup — a slide held across interval samples cost several near-identical vision calls, and the even-cap dropped distinct slides in long decks. - `dedupe_frames` (perceptual dHash, Hamming distance) drops consecutive near-duplicate frames (a held slide) so the budget covers DISTINCT slides. extract_key_frames is now **extract → dedupe → cap**; the cap becomes a safety ceiling (default 40 → 60) since dedup is the real reducer. No new dependency (Pillow dHash). - `[frames]` config block (`max_frames`, `scene_threshold`, `interval_seconds`, `dedupe`, `dedupe_distance`), plumbed through `_build_visual_config`. Defaults preserve behaviour except dedup on (strictly fewer, distinct frames). - Tests: dHash stability/discrimination, dedupe drops dups / keeps distinct / keeps unreadable; config defaults + overrides + validation. Decisions locked in zz-support-files impl plan: all distinct slides (no artificial cap), [frames] name. 1095 tests, 95% cov, gate green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…onfig (PR-A review) Addresses the bug-finder review of the dedup PR: - A (medium): dedup ran BEFORE classify_visual, biasing the slides-vs-talking-head vote toward "slides" (the branch that fires the VLM per frame). Restructured to extract RAW (extract_key_frames cap=False) → classify on the raw distribution → `select_frames` (dedupe + cap) → describe. New `reduce_fn` on VisualConfig (default identity), applied after classification; dedup no longer skews the vote. - B (low-med): `select_frames` now WARNS when the cap clips distinct slides (a 60+-distinct-slide deck losing frames is surfaced, not silent). - C (low): validate [frames].scene_threshold ∈ [0,1] and interval_seconds > 0 (interval 0 would make ffmpeg select every frame). Tests: cap=False returns raw; select_frames dedupe→cap; distinct-slide mock (dedup no longer collapses the CLI persist test); scene_threshold/interval validation. 1099 tests, 95% cov, gate green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First PR of the frames-layer redesign. The extractor kept up to 40 frames spread evenly across a video with no dedup — a slide held across interval samples cost several near-identical vision calls, and the even-cap dropped distinct slides in long decks.
What
dedupe_frames— perceptual dHash (8×8, Hamming distance) drops consecutive near-duplicate frames (a held slide), so the frame budget covers distinct slides.extract_key_framesis now extract → dedupe → cap; the cap is a safety ceiling (default 40 → 60) since dedup is the real reducer. No new dependency (Pillow dHash).[frames]config (max_frames,scene_threshold,interval_seconds,dedupe,dedupe_distance), plumbed through_build_visual_config→extract_key_frames. Defaults preserve behaviour except dedup on (strictly fewer, distinct frames).Tests
dHash stability + discrimination + None-on-unreadable; dedupe drops dups / keeps distinct / keeps unreadable;
[frames]defaults + overrides + validation. 1095 tests, 95% cov, gate green.Next in the branch series: PR-B warm server, PR-C transcript-informed selection, PR-D captioning context, PR-E frame worklist/resume.