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
| Type | Usage | Example |
|---|---|---|
| wandb.Image | Images with optional masks/boxes | wandb.Image(arr, caption="cat") |
| wandb.Audio | Audio clips | wandb.Audio(arr, sample_rate=44100) |
| wandb.Video | Video files | wandb.Video("clip.mp4") |
| wandb.Html | Rich HTML content | wandb.Html("<b>bold</b>") |
| Primitives | Numbers, strings, booleans | 42, "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.
AI & ML Courses - 30% Off
Live instructor-led AI, machine learning, data science, and cloud courses for working professionals. Use code Limited30 at checkout.
EdurekaDataCamp - AI & Data Science
Hands-on Python, machine learning, and AI courses with interactive exercises and real projects.
DataCampedX - Top AI Courses
University-level AI courses from MIT, Harvard, Stanford. Earn certificates that employers recognize.
edX