code: def deepchecks_collate(model) -> t.Callable:
      """Process batch to deepchecks format.
  
      Parameters
      ----------
      model : nn.Module
          model to predict with
      Returns
      -------
      BatchOutputFormat
          batch of data in deepchecks format
      """
  
      def _process_batch_to_deepchecks_format(
          data,
      ) -> BatchOutputFormat:
          raw_images = [x[0] for x in data]
          images = [
              object_to_numpy(tensor).transpose((1, 2, 0))
              for tensor in raw_images
          ]
          labels = [x[1] for x in data]
  
          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 raw_images
          ]
  
          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 {
              "images": images,
              "labels": labels,
              "predictions": predictions,
          }
  
      return _process_batch_to_deepchecks_format
  
imports: import contextlib
  import os
  import pathlib
  import typing
  from pathlib import Path
  import albumentations
  import numpy
  import torch
  import torchvision.transforms.functional
  from albumentations.pytorch.transforms import ToTensorV2
  from PIL import Image, ImageDraw
  from torch import nn
  from torch.utils.data import DataLoader
  from typing_extensions import Literal
  from deepchecks.vision.utils.test_utils import get_data_loader_sequential
  from deepchecks.vision.vision_data import BatchOutputFormat, VisionData
  from deepchecks.vision.vision_data.utils import object_to_numpy
label_desc: Use image node_id 3 for calling a global function with example usage: deepchecks_collate(model) and returns: _process_batch_to_deepchecks_format, dict