Intermediate

W&B Tables

Log, query, and visualize structured data interactively. Debug model predictions, analyze datasets, and compare outputs across runs.

Logging Tables

Python - Create and log a table
import wandb

run = wandb.init(project="tables-demo")

# Create a table with columns
table = wandb.Table(columns=["image", "label", "prediction", "confidence"])

for img, label, pred, conf in zip(images, labels, predictions, confidences):
    table.add_data(
        wandb.Image(img),
        label,
        pred,
        round(conf, 3)
    )

wandb.log({"predictions": table})
run.finish()

Supported Column Types

TypeUsageExample
wandb.ImageImages with optional masks/boxeswandb.Image(arr, caption="cat")
wandb.AudioAudio clipswandb.Audio(arr, sample_rate=44100)
wandb.VideoVideo fileswandb.Video("clip.mp4")
wandb.HtmlRich HTML contentwandb.Html("<b>bold</b>")
PrimitivesNumbers, strings, booleans42, "cat", True

Tables with Bounding Boxes

Python - Object detection results
table = wandb.Table(columns=["image", "num_objects", "iou"])

for img, boxes, scores in detection_results:
    box_data = []
    for box, score in zip(boxes, scores):
        box_data.append({
            "position": {
                "minX": box[0], "minY": box[1],
                "maxX": box[2], "maxY": box[3]
            },
            "class_id": int(box[4]),
            "scores": {"confidence": float(score)}
        })

    img_with_boxes = wandb.Image(img, boxes={
        "predictions": {"box_data": box_data}
    })
    table.add_data(img_with_boxes, len(boxes), mean_iou)

wandb.log({"detections": table})

Joining Tables Across Runs

Python - Compare predictions from different models
# Log the same dataset table in multiple runs
# W&B will let you join and compare them in the UI

# Run 1: ResNet predictions
with wandb.init(project="compare", name="resnet") as run:
    table = wandb.Table(columns=["id", "image", "prediction", "confidence"])
    for i, (img, pred, conf) in enumerate(resnet_results):
        table.add_data(i, wandb.Image(img), pred, conf)
    wandb.log({"eval_results": table})

# Run 2: EfficientNet predictions
with wandb.init(project="compare", name="efficientnet") as run:
    table = wandb.Table(columns=["id", "image", "prediction", "confidence"])
    for i, (img, pred, conf) in enumerate(effnet_results):
        table.add_data(i, wandb.Image(img), pred, conf)
    wandb.log({"eval_results": table})
Power feature: In the W&B UI, you can filter, sort, and group Table rows interactively. Use the "Join" feature to compare the same samples across different runs side-by-side - essential for understanding where one model outperforms another.

Ready to Go Deeper?

Live instructor-led courses from our partners. Affiliate disclosure.