Skip to main content

SVLM Utils - Video and Image Processing Utilities for SVECTOR-VLM

Project description

SVLM Utils

SVLM Utils - Video and Image Processing Utilities for SVECTOR Video Language Model (SVLM)

PyPI version Python 3.10+ License

Installation

pip install svlm-utils

Quick Start

from svlm_utils import process_vision_info, fetch_image, fetch_video

# Process messages with images/videos
messages = [
    {
        "role": "user",
        "content": [
            {"type": "text", "text": "Describe this video"},
            {"type": "video", "video": "path/to/video.mp4", "max_fps": 8},
        ],
    }
]

images, videos, video_kwargs = process_vision_info(messages)

Features

  • 🎬 Video Processing: Load and sample video frames with configurable FPS
  • 🖼️ Image Processing: Fetch images from URLs, base64, or local files
  • 🔧 Multiple Backends: Support for decord, torchcodec, and PyAV
  • Optimized Sampling: Intelligent frame sampling for efficient processing

Video Loading Options

# Load video with specific settings
video_config = {
    "video": "path/to/video.mp4",
    "max_fps": 8,            # Maximum frames per second to sample
    "num_frames": 64,        # Maximum total frames
    "clip": (0, 10),         # Optional: extract specific time range (seconds)
}

video_frames, metadata = fetch_video(video_config)

Supported Formats

Images

  • Local files: image.jpg, image.png
  • URLs: http://..., https://...
  • Base64: data:image/jpeg;base64,...
  • PIL Images: Direct PIL.Image objects

Videos

  • Local files: .mp4, .avi, .mov, .webm
  • File URLs: file:///path/to/video.mp4

License

Apache License 2.0

Author

SVECTOR Corporation - https://svector.co

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

svlm_utils-1.0.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

svlm_utils-1.0.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file svlm_utils-1.0.0.tar.gz.

File metadata

  • Download URL: svlm_utils-1.0.0.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for svlm_utils-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f7a9e088a0a9b2559f0dd28fa8afd095e35af5d7e1ba570e2599d9c84594f36e
MD5 082e49a2af5fb077c2898c3aebadc8f7
BLAKE2b-256 68283db4fe307c13ecc54ff03defb2afb3429327ad32ed252274adb9a0444acb

See more details on using hashes here.

File details

Details for the file svlm_utils-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: svlm_utils-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for svlm_utils-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f327bd155d06eb6a74083306b756fdc0e7c71e682dfc4f80eb811629109a5a9f
MD5 23ae533b547d942cc98a8a9a8fe41875
BLAKE2b-256 4cb824583d7873cecb72ac9c871b85e69e3defaf4acc18bf38e2823fd1f6522d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page