Skip to main content

vlm-sieve (v0.2.0)

Local-First, Zero-GPU Spatial-Temporal Video Gatekeeper & Storyboard Packer for Vision-Language Models (VLMs)

vlm-sieve sits in front of Vision-Language Models (Gemini, GPT-4o, Claude, Qwen-VL, Llama-Vision) to filter out dead air, merge fragmented motion bursts into coherent episodes, crop active Regions-of-Interest (ROIs) with generous context padding, and pack peak-preserving keyframes into composite spatial-temporal storyboards.


What's New in v0.2.0

  1. Bit-Stream Frame Striding (sample_fps=10.0) + Lazy RGB Caching: Uses cap.grab() at the demuxer level to skip intermediate frames without decoding pixel buffers, cutting local CPU preprocessing time by 60%+.
  2. Episode Merging (merge_gap_sec=6.0) + Bridge Frames: Combines adjacent motion bursts separated by brief pauses and retains ~2 FPS bridge frames across merged gaps so multi-second interactions emit a single unified storyboard instead of fragmenting.
  3. Micro-Motion Circular Pre-Roll Buffer (pre_roll_sec=3.0, pre_roll_min_score=0.0025): Captures subtle early approaches (e.g., distant sidewalk footsteps) before the main foreground threshold is crossed.
  4. Hybrid Peak-Preserving Keyframe Sampler: Prevents <1.5s duplicate frames while preserving transient action peaks (such as a 1-second doorbell button press).
  5. Global Camera-Disturbance Classifier (suppress_disturbances=True): Automatically identifies full-frame camera shake or auto-exposure flashes, logs the timestamp in summary.json, and suppresses redundant empty-room storyboard images.
  6. Both-Axis Tile Clamping (tile_max_dim=640) & Wider Context Padding (roi_padding_ratio=0.35): Clamps both max(width, height) per tile and preserves surrounding scene context around objects.

Real-World Provider-Counted Gemini Benchmarks

Measured using provider-reported usage_metadata.prompt_token_count on Gemini 3.8 Flash across both visual-only and full audiovisual (Storyboards + 32kbps MP3 Audio) pipelines:

1. 5m 22s Ring Home Security Footage (1280x720 @ 30 FPS, 9,658 frames)

Pipeline Mode Emitted Payload Provider Input Tokens Input Token Savings Est. API Cost Local CPU Time
Direct Gemini Video Upload Full .webm (322s) 29,403 Baseline $0.02895 N/A (18.3s upload/wait)
vlm-sieve v0.2.0 (Visual-Only) 4 Storyboards + 1 Shake Log 4,823 83.60% saved $0.01197 (58.7% saved) 17.08s
vlm-sieve v0.2.0 (Visual + Audio) 4 Storyboards + 1.2 MB .mp3 12,925 56.04% saved $0.01835 (36.6% saved) 18.34s

2. 40s Vivint Doorbell Footage (720x720 @ 15 FPS, 600 frames)

Pipeline Mode Emitted Payload Provider Input Tokens Input Token Savings Est. API Cost End-to-End Latency
Direct Gemini Video Upload Full .mp4 (40s) 3,659 Baseline $0.00641 19.20s
vlm-sieve v0.2.0 (Visual-Only) 1 Storyboard (1408x1292) 1,292 64.69% saved $0.00431 (32.8% saved) 11.62s (39.5% faster)
vlm-sieve v0.2.0 (Visual + Audio) 1 Storyboard + 157 KB .mp3 2,346 35.88% saved $0.00536 (16.4% saved) 16.04s (16.5% faster)

Installation

pip install -U vlm-sieve

Quickstart (Python API)

from vlmsieve import VideoSieve

sieve = VideoSieve(
    source="security_footage.mp4",
    sample_fps=10.0,
    pre_roll_sec=3.0,
    merge_gap_sec=6.0,
    tile_max_dim=640,
    suppress_disturbances=True,
)

events = sieve.process_video_to_dir("./sieve_output")
report = sieve.get_savings_report()

for ev in events:
    print(
        f"Event {ev.event_id}: {ev.start_time_sec:.2f}s - {ev.end_time_sec:.2f}s | "
        f"Keyframes: {ev.keyframe_times_sec} | Size: {ev.storyboard_pil.size}"
    )

Command-Line Interface (CLI)

vlmsieve ./input_video.mp4 -o ./sieve_output --pre-roll-sec 3.5 --merge-gap-sec 6.0
python -m vlmsieve ./input_video.mp4 -o ./sieve_output

License

MIT License

Metadata

Release files for vlm-sieve 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vlm-sieve 0.2.0
File Size Uploaded Provenance Actions
vlm_sieve-0.2.0.tar.gz 183.8 kB Without provenance Details for vlm_sieve-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vlm-sieve 0.2.0
File Interpreter ABI Platform Actions
vlm_sieve-0.2.0-py3-none-any.whl Python 3 none any Details for vlm_sieve-0.2.0-py3-none-any.whl

Total release size: 204.7 kB

Release files / vlm_sieve-0.2.0.tar.gz

Download URL vlm_sieve-0.2.0.tar.gz
Size 183.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8c6cf772cf67ac669f9898bfcc5494086f08d6d10c1010282e74a6b761dcaf24
BLAKE2b-256 checksum
How to use checksums
536ef301aa39a76b5c509bdb85994ecb44f00ed91ed01cd7c47fb1f9fa5d42cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.1

Release files / vlm_sieve-0.2.0-py3-none-any.whl

Download URL vlm_sieve-0.2.0-py3-none-any.whl
Size 20.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e76a2da991d8090f7e553ff80b9e2347f9e12f78e504535ae58ff9c27613b0e4
BLAKE2b-256 checksum
How to use checksums
866b2e76a4d675565c2a698b2850c6fbdbcdf428307081ccdfe00ca0c519ddc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.1

Security for vlm-sieve 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page