Documentation
Search…
wandb.data_types.Video
Format a video for logging to W&B.
1
Video(
2
data_or_path: Union['np.ndarray', str, 'TextIO'],
3
caption: Optional[str] = None,
4
fps: int = 4,
5
format: Optional[str] = None
6
)
Copied!
Arguments
Text
data_or_path
(numpy array, string, io) Video can be initialized with a path to a file or an io object. The format must be "gif", "mp4", "webm" or "ogg". The format must be specified with the format argument. Video can be initialized with a numpy tensor. The numpy tensor must be either 4 dimensional or 5 dimensional. Channels should be (time, channel, height, width) or (batch, time, channel, height width)
caption
(string) caption associated with the video for display
fps
(int) frames per second for video. Default is 4.
format
(string) format of video, necessary if initializing with path or io object.

Examples:

Log a numpy array as a video

1
import numpy as np
2
import wandb
3
4
wandb.init()
5
# axes are (time, channel, height, width)
6
frames = np.random.randint(low=0, high=256, size=(10, 3, 100, 100), dtype=np.uint8)
7
wandb.log({"video": wandb.Video(frames, fps=4)})
Copied!

Methods

encode

1
encode() -> None
Copied!
Class Variables
Text
EXTS