train_ds.set_transform(train_transforms)
test_ds.set_transform(val_transforms)

Evaluate
Including a metric during training is often helpful for evaluating your model's performance. You can quickly load an evaluation method with the 🤗 Evaluate library. For this task, load the mean Intersection over Union (IoU) metric (see the 🤗 Evaluate quick tour to learn more about how to load and compute a metric):

import evaluate
metric = evaluate.load("mean_iou")