feat(action): add reusable clip/window abstraction for video understanding - #148
Open
ik020 wants to merge 4 commits into
Open
feat(action): add reusable clip/window abstraction for video understanding#148ik020 wants to merge 4 commits into
ik020 wants to merge 4 commits into
Conversation
…rs#83 Extracts clip grouping into core/clip.py (VideoClip, ClipStreamAccumulator), decoupling clip boundaries from the VideoPrism encoder. Fixed-window mode preserves existing behavior exactly (verified by existing test suite).
…s#83 Adds core/scene_boundaries.py (PySceneDetect wrapper) and threads source through the shared VisualProcessor.prepare() so action's indexer can detect real shot boundaries when clip_mode='scene'. Default clip_mode='fixed' behavior is unchanged.
Verifies prepare() calls detect_shot_boundaries and passes them into ClipStreamAccumulator, and that process/finalize produce clips whose start/end/sample_count respect the shot boundaries rather than fixed 16-frame windows.
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.
Summary
Closes #83
This PR introduces a reusable clip/window abstraction for video understanding and adds shot-based clip generation to the VideoPrism action capability.
Changes
VideoClipandClipStreamAccumulatorabstractions for reusable video clip/window handling.fixed— existing fixed-size window behavior (default)scene— shot-based windows using PySceneDetectclip_modeonly acceptsfixedorscene.Validation
tests/test_videoprism.py— 5 passedtests/test_capabilities.py— 17 passed, 2 subtests passedgit diff --check— passedBenchmark
Using a synthetic 9-second video containing 3 shots:
The benchmark mocks VideoPrism model inference and therefore measures clip/windowing and shot-detection overhead rather than end-to-end VideoPrism inference.
Notes
fixedremains the default mode, so existing behavior is preserved unlessclip_mode="scene"is explicitly selected.