Skip to content

Image

Image(
data_or_path: np.ndarray | Any | str | os.PathLike[str],
caption: str = '',
file_type: str | None = None,
normalize: bool = True
) -> None

Wraps image data for logging. Compatible with wandb.Image interface.

Construction never raises for data-dependent problems — building media mid-training must not crash the job. Invalid inputs (unsupported file_type, non-finite or out-of-range numpy data) set invalid_reason instead (like Histogram), and Run.log() drops the item with a warning plus a run diagnostic.

Write image data to an image file.