Skip to main content

Module image_utils

Module image_utils 

Source
Expand description

Image loading and preprocessing utilities for multimodal models

This module provides utilities for:

  • Loading images from disk (PNG, JPEG, etc.)
  • Preprocessing images for vision encoders
  • Creating fallback minimal images
  • Batch image processing

Structs§

ImageInput
Image data structure for passing around
ImagePreprocessConfig
Image preprocessing configuration

Functions§

batch_images
Batch multiple images into a single tensor
create_fallback_image
Create a minimal fallback image (1x1 random pixel expanded to full size)
load_image
Load an image from disk and preprocess it for vision encoder
load_image_from_bytes
Load an image from raw bytes (PNG, JPEG, or other formats supported by image crate)
load_images
Load multiple images and batch them