spdl.io.load_image_batch

load_image_batch(srcs: list[str | bytes], *, width: int | None, height: int | None, pix_fmt: str | None = 'rgb24', demux_config: DemuxConfig | None = None, decode_config: DecodeConfig | None = None, filter_desc: str | None = _FILTER_DESC_DEFAULT, device_config: None = None, storage: CPUStorage | None = None, strict: bool = True, **kwargs) CPUBuffer[source]
load_image_batch(srcs: list[str | bytes], *, width: int | None, height: int | None, pix_fmt: str | None = 'rgb24', demux_config: DemuxConfig | None = None, decode_config: DecodeConfig | None = None, filter_desc: str | None = _FILTER_DESC_DEFAULT, device_config: CUDAConfig, storage: CPUStorage | None = None, strict: bool = True, **kwargs) CUDABuffer

Batch load images.

This function combines demux_image(), decode_packets(), convert_frames(), and optionally, transfer_buffer(), to produce buffer object from source in one step.

Parameters:
  • srcs – List of source identifiers.

  • widthOptional: Resize the frame.

  • heightOptional: Resize the frame.

  • pix_fmtOptional: The output pixel format.

  • demux_configOptional: Demux configuration passed to demux_image().

  • decode_configOptional: Decode configuration passed to decode_packets().

  • filter_descOptional: Filter description passed to decode_packets().

  • device_configOptional: The CUDA device passed to transfer_buffer(). Providing this argument will move the resulting buffer to the CUDA device.

  • storageOptional: The storage object passed to convert_frames().

  • strictOptional: If True, raise an error if any of the images failed to load.

Returns:

A buffer object.