Skip to content

feat(digest): dedupe near-duplicate slide frames + configurable [frames] (frames-redesign PR-A)#74

Merged
VGonPa merged 2 commits into
developfrom
feat/frames-dedupe
Jul 4, 2026
Merged

feat(digest): dedupe near-duplicate slide frames + configurable [frames] (frames-redesign PR-A)#74
VGonPa merged 2 commits into
developfrom
feat/frames-dedupe

Conversation

@VGonPa

@VGonPa VGonPa commented Jul 4, 2026

Copy link
Copy Markdown
Owner

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_frames is 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_configextract_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.

VGonPa and others added 2 commits July 4, 2026 13:10
…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>
@VGonPa VGonPa merged commit cd1ce05 into develop Jul 4, 2026
1 check passed
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