code: def deepchecks_collate_fn(batch) -> BatchOutputFormat:
      """Return a batch of images, labels and predictions for a batch of data. The expected format is a dictionary with
      the following keys: 'images', 'labels' and 'predictions', each value is in the deepchecks format for the task.
      You can also use the BatchOutputFormat class to create the output.
      """
      # batch received as iterable of tuples of (image, label) and transformed to tuple of iterables of images and labels:
      batch = tuple(zip(*batch))
  
      # images:
      images = [
          tensor.numpy().transpose((1, 2, 0)) for tensor in batch[0]
      ]
  
      # labels:
      labels = batch[1]
  
      # predictions:
      normalized_batch = [
          F.normalize(
              img.unsqueeze(0).float() / 255,
              mean=[0.485, 0.456, 0.406],
              std=[0.229, 0.224, 0.225],
          )
          for img in batch[0]
      ]
      predictions = [
          model(img)["out"].squeeze(0).detach()
          for img in normalized_batch
      ]
      predictions = [
          torch.nn.functional.softmax(pred, dim=0)
          for pred in predictions
      ]
  
      return BatchOutputFormat(
          images=images, labels=labels, predictions=predictions
      )
  
file_path: deepchecks/docs/source/vision/tutorials/quickstarts/plot_segmentation_tutorial.py
imports: from deepchecks.vision.datasets.segmentation.segmentation_coco import CocoSegmentationDataset, load_model
  import torch
  import torchvision.transforms.functional
  from deepchecks.vision.vision_data import BatchOutputFormat
  from torch.utils.data import DataLoader
  from deepchecks.vision import VisionData
  from deepchecks.vision.suites import model_evaluation
label_desc: Use image node_id 1 for calling a global function with example usage: deepchecks_collate_fn(batch) and returns: BatchOutputFormat