Skip to main content
Image logging is supported on the platform that are in the format of: To log an image, instantiate the mlop.Image class.
img = mlop.Image(
    data: Union[str, PILImage.Image, matplotlib.figure.Figure, torch.Tensor, np.ndarray],
    caption: str | None = None,
)
mlop.log({"image/file/0-0": img})
ParameterTypeDescription
dataUnion[str, PILImage.Image, matplotlib.figure.Figure, torch.Tensor, np.ndarray]The image data to log. Can be a path to an image file, a PIL image, a Matplotlib figure, a PyTorch tensor, or a NumPy array.
captionstrA caption for the image.