SVLM Utils
SVLM Utils - Video and Image Processing Utilities for SVECTOR Video Language Model (SVLM)
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
Metadata
Release files for svlm-utils 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| svlm_utils-1.0.0.tar.gz | 17.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| svlm_utils-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.8 kB
Release files / svlm_utils-1.0.0.tar.gz
| Download URL | svlm_utils-1.0.0.tar.gz |
|---|---|
| Size | 17.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f7a9e088a0a9b2559f0dd28fa8afd095e35af5d7e1ba570e2599d9c84594f36e
|
|
BLAKE2b-256 checksum How to use checksums |
68283db4fe307c13ecc54ff03defb2afb3429327ad32ed252274adb9a0444acb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / svlm_utils-1.0.0-py3-none-any.whl
| Download URL | svlm_utils-1.0.0-py3-none-any.whl |
|---|---|
| Size | 16.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f327bd155d06eb6a74083306b756fdc0e7c71e682dfc4f80eb811629109a5a9f
|
|
BLAKE2b-256 checksum How to use checksums |
4cb824583d7873cecb72ac9c871b85e69e3defaf4acc18bf38e2823fd1f6522d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|