For details, see the Data types reference.
For more details, see a demo report on visualizing model predictions or watch a video walkthrough.
Prerequisites
To log media objects with the W&B SDK, you may need to install additional dependencies that support the media types you plan to use. Install them by running the following command.Images
Log images to track inputs, outputs, filter weights, and activations.
Log fewer than 50 images per step to prevent logging from becoming a bottleneck during training, and to prevent image loading from becoming a bottleneck when viewing results.
- Log arrays as images
- Log PIL images
- Log images from files
Provide arrays directly when constructing images manually, such as by using The SDK assumes the image is gray scale if the last dimension is 1, RGB if it’s 3, and RGBA if it’s 4. If the array contains floats, the SDK converts them to integers between
make_grid from torchvision.The SDK converts arrays to PNG using Pillow.0 and 255. To normalize your images differently, specify the mode manually or supply a PIL.Image, as described in the “Log PIL images” tab of this panel.Image overlays
You can attach overlays such as segmentation masks and bounding boxes to logged images so you can inspect predictions and ground-truth annotations directly in the W&B UI. The following tabs show how to log each overlay type.- Segmentation masks
- Bounding boxes
Log semantic segmentation masks and interact with them in the W&B UI, such as by altering opacity and viewing changes over time.
To log an overlay, provide a dictionary with the following keys and values to the Segmentation masks for a key are defined at each step (each call to

masks keyword argument of wandb.Image:- one of two keys representing the image mask:
"mask_data": a 2D NumPy array containing an integer class label for each pixel"path": (string) a path to a saved image mask file
"class_labels": (optional) a dictionary mapping the integer class labels in the image mask to their readable class names
run.log()).- If steps provide different values for the same mask key, only the most recent value for the key is applied to the image.
- If steps provide different mask keys, all values for each key are shown, but only those defined in the step being viewed are applied to the image. Toggling the visibility of masks not defined in the step doesn’t change the image.
Image overlays in tables
To include image overlays inside awandb.Table, construct a wandb.Image for each row and pass it as a table cell. The following tabs show how to do this for segmentation masks and bounding boxes.
- Segmentation masks
- Bounding boxes

wandb.Image object for each row in the table.The following code snippet shows an example.Histograms
Log histograms to track the distribution of values, such as gradients or activations, across training steps. The following tabs show basic and flexible approaches.- Log a basic histogram
- Log a flexible histogram
If you provide a sequence of numbers, such as a list, array, or tensor, as the first argument, the SDK constructs the histogram automatically by calling 
np.histogram(). The SDK flattens all arrays/tensors. Use the optional num_bins keyword argument to override the default of 64 bins. The maximum number of bins supported is 512.In the UI, histograms are plotted with the training step on the x-axis, the metric value on the y-axis, and the count represented by color, which eases comparison of histograms logged throughout training. See the “Histograms in Summary” tab of this panel for details on logging one-off histograms.
3D visualizations
Log 3D point clouds and Lidar scenes with bounding boxes. Pass in a NumPy array containing coordinates and colors for the points to render.The W&B UI truncates the data at 300,000 points.
NumPy array formats
The SDK supports three different formats of NumPy arrays for flexible color schemes.[[x, y, z], ...]nx3[[x, y, z, c], ...]nx4| c is a categoryin the range[1, 14](Useful for segmentation)[[x, y, z, r, g, b], ...]nx6 | r,g,bare values in the range[0,255]for red, green, and blue color channels.
Python object
With this schema, you can define a Python object and pass it to thefrom_point_cloud method.
pointsis a NumPy array containing coordinates and colors for the points to render using the same formats as the simple point cloud renderer.boxesis a NumPy array of Python dictionaries with three attributes:corners- a list of eight cornerslabel- a string representing the label to render on the box (optional)color- RGB values representing the color of the boxscore- a numeric value that displays on the bounding box and that you can use to filter the bounding boxes shown (for example, to only show bounding boxes wherescore>0.75). (optional)
typeis a string representing the scene type to render. The only supported value islidar/beta.
Point cloud files
Use thefrom_file method to load a JSON file full of point cloud data.
NumPy arrays
With the same array formats, you can usenumpy arrays directly with the from_numpy method to define a point cloud.
wandb.Molecule:
pdb, pqr, mmcif, mcif, cif, sdf, sd, gro, mol2, or mmtf.
W&B also supports logging molecular data from SMILES strings, rdkit mol files, and rdkit.Chem.rdchem.Mol objects.

PNG image
wandb.Image converts numpy arrays or instances of PILImage to PNGs by default.
Video
Log videos with thewandb.Video data type:
2D view of a molecule
You can log a 2D view of a molecule using thewandb.Image data type and rdkit:
Other media
W&B also supports logging other media types, including audio, video, text tables, and HTML. The following sections show how to log each type.Audio
audio-file.
Video
ffmpeg and the moviepy Python library are required when you pass NumPy objects). Supported formats are "gif", "mp4", "webm", and "ogg". If you pass a string to wandb.Video, the SDK asserts the file exists and is a supported format before uploading to W&B. If you pass a BytesIO object, the SDK creates a temporary file with the specified format as the extension.
Your videos appear in the Media section of the W&B run and project pages.
For more usage information, see video-file.
Text
Usewandb.Table to log text in tables that appear in the UI. By default, the column headers are ["Input", "Output", "Expected"]. To ensure optimal UI performance, the default maximum number of rows is set to 10,000. However, you can explicitly override the maximum with wandb.Table.MAX_ROWS = 200000.
DataFrame object.
string.
HTML
inject=False.
html-file.
