Experiments/Visualizations

Videos

Visualize your videos

mlop supports logging many different video types to the platform, you can currently log media that are of the format of:

  • MP4 - MPEG-4 Part 14 container format
  • GIF - Graphics Interchange Format
  • WebM - Open web media format
  • M4A - MPEG-4 Audio format
  • OGG - Free, open container format

To use video logging you first need to instantiate the mlop.Video class

video = mlop.Video(
    data: Union[str, np.ndarray],
    rate: int | None = 30,
    caption: str | None = None,
    format: str | None = None,
)
mlop.log({"video/file/0-0": video})
ParameterTypeDescription
dataUnion[str np.ndarray]The video data to log. Can be a path to a video file or a NumPy array.
rateintThe frame rate of the video. Defaults to 30.
captionstrA caption for the video.
formatstrThe format of the video. Defaults to mp4.

Supported Formats

mlop uses moviepy and imageio as its backend for video logging, with the following supported formats.

Examples

Logging Videos from File Paths

path = "video.mp4"
mlop.log({"video": mlop.Video(path)})

Logging Videos from NumPy Arrays

data = np.random.randint(low=0, high=256, size=(10, 3, 112, 112), dtype=np.uint8)
mlop.log({"video": mlop.Video(data)})

On this page