agent: temporal video dedup — drop near-duplicate frames before the GPU #175
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to the spatial crop dedup (#174). Cuts the dominant video GPU load.
Near-static videos are sampled into up to 64 frames, each re-running the whole detect→CCIP→SigLIP chain on ~identical content. Add a CPU perceptual-hash frame dedup upstream of the GPU so redundant frames are never processed at all (not just their embeds):
media.dedupe_frames()+_dhash(): 8×8 difference-hash (64-bit) per frame; greedy keep — a frame survives only if its hash differs from every kept frame by ≥min_distancebits (Hamming). A static run collapses to one frame; distinct scenes all survive. Order +frame_timepreserved.worker._download_decoderight aftersample_frames, so it runs in the decode stage on the downloader thread — GPU consumers only ever see deduped frames, and buffered video items shrink (less RAM).FRAME_DEDUPE_DISTANCE(default 8; higher keeps more frames for brief localized changes an 8×8 hash can miss; 0 disables). Logsvideo frames N→Mwhen it drops any.This is the temporal axis complementing the per-frame spatial crop dedup. Build marker
2026-07-01.3. CI green on dev (run 1815); validated on the desktop after pull.🤖 Generated with Claude Code