Skip to main content

load_image

Function load_image 

Source
pub fn load_image(
    path: &Path,
    config: &ImagePreprocessConfig,
    device: Device,
) -> Result<Tensor>
Expand description

Load an image from disk and preprocess it for vision encoder

§Arguments

  • path - Path to the image file
  • config - Preprocessing configuration
  • device - Device to load tensor onto

§Returns

Tensor of shape [1, 3, H, W] ready for vision encoder