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 = [
              np.array(x.permute(1, 2, 0)) * 255 for x in raw_images
          ]
  
          def extract_dict(in_dict):
              return torch.concat(
                  [
                      in_dict["labels"].reshape((-1, 1)),
                      in_dict["boxes"],
                  ],
                  axis=1,
              )
  
          labels = [extract_dict(x[1]) for x in data]
  
          predictions = model(raw_images)
          return {
              "images": images,
              "labels": labels,
              "predictions": predictions,
          }
  
      return _process_batch_to_deepchecks_format
  
imports: import contextlib
  import hashlib
  import json
  import os
  import pathlib
  import typing
  import urllib.request
  from pathlib import Path
  import numpy
  import torch
  from bs4 import BeautifulSoup
  from PIL import Image
  from torch import nn
  from torch.utils.data import DataLoader
  from typing_extensions import Literal
  from deepchecks.vision.utils.test_utils import IndicesSequentialSampler
  from deepchecks.vision.vision_data import BatchOutputFormat, VisionData
  from deepchecks.vision.vision_data.utils import object_to_numpy
label_desc: Use image node_id 2 for calling a global function with example usage: deepchecks_collate(model) and returns: _process_batch_to_deepchecks_format, dict, torch