Skip to navigation

nemo_automodel.components.datasets.vlm.media

View as Markdown

Spatial image assembly shared by native and streaming VLM loaders.

Module Contents

Functions

NameDescription
pad_image_tensorsZero-pad processor images to a common spatial size without resizing.

API

nemo_automodel.components.datasets.vlm.media.pad_image_tensors(
values: collections.abc.Sequence[torch.Tensor]
) -> torch.Tensor

Zero-pad processor images to a common spatial size without resizing.

Parameters:

values
Sequence[torch.Tensor]

Image tensors [images, channels, height, width], with matching channel counts. Original unpadded sizes travel in image_sizes.

Returns: torch.Tensor

Concatenated images [total_images, channels, max_height, max_width].