Reduce CPU memory usage for long videos - #87
Open
heiwang1997 wants to merge 1 commit into
Open
Conversation
|
I've been experimenting with this yesterday and today, and it makes a big difference with the dataset I'm using. I don't have a precise comparison to share (I wasn't using |
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
uint8on CPU and restore float RGB when moving cached frames back to CUDA.vipe inferstream inputs by default, with--cache-inputas an opt-in fallback for malformed videos.Related issues: #44, #61, #66, #68.
Long-video RAM benchmark
Benchmark video:
/tmp/vipe-ram-bench/dog-488f.mp4, generated by loopingassets/examples/dog-example.mp4to 488 frames at 1280x720, duration 16.28s. Measurements used/usr/bin/time -v.End-to-end checks on the same synthesized clip:
adaptive_unidepth-l_svda, instance off, no vizThe default VDA path is still the heavier mode because it stages whole-video depth alignment data, but cached RGB retention is reduced 4x and the artifact path no longer forces a full post-depth output cache.
Validation
uv run --group dev ruff check vipe/streams/base.py vipe/pipeline/processors.py vipe/priors/depth/videodepthanything/video_depth.py vipe/cli/main.py vipe/utils/io.py vipe/pipeline/default.py vipe/pipeline/panorama.py tests/test_memory_usage.pyuv run --group dev ruff format --check vipe/streams/base.py vipe/pipeline/processors.py vipe/priors/depth/videodepthanything/video_depth.py vipe/cli/main.py vipe/utils/io.py vipe/pipeline/default.py vipe/pipeline/panorama.py tests/test_memory_usage.pyuv run --group dev mypy vipe/streams/base.py vipe/pipeline/default.py vipe/pipeline/panorama.py vipe/cli/main.py vipe/utils/io.py vipe/pipeline/processors.pyuv run --group dev pytest-> 31 passed