code: def convert_batch_of_bboxes(
      batch: _BatchOfSamples, notation: str
  ) -> List[np.ndarray]:
      """Convert batch of bboxes to the required format.
  
      Parameters
      ----------
      batch : iterable of tuple like object with two items - image, list of bboxes
          batch of images and bboxes corresponding to them
      notation : str
          bboxes format notation
  
      Returns
      -------
      List[np.ndarray]
          list of transformed bboxes
      """
      (
          are_coordinates_normalized,
          notation_tokens,
      ) = verify_bbox_format_notation(notation)
      output = []
  
      for image, bboxes in batch:
          if len(bboxes) == 0:
              # image does not have bboxes
              output.append(np.asarray([]))
              continue
  
          if are_coordinates_normalized is False:
              image_height = None
              image_width = None
          elif isinstance(image, Image):
              image_height, image_width = image.height, image.width
          elif is_torch_object(image) or isinstance(image, np.ndarray):
              image_height, image_width, *_ = image.shape
          else:
              raise TypeError(
                  "Do not know how to take dimension sizes of "
                  f"object of type - {type(image)}"
              )
  
          r = []
          for bbox in bboxes:
              if len(bbox) < 5:
                  raise ValueError(
                      "incorrect bbox"
                  )  # TODO: better message
              else:
                  r.append(
                      _convert_bbox(
                          bbox,
                          notation_tokens,
                          image_width=image_width,
                          image_height=image_height,
                      )
                  )
          output.append(np.stack(r, axis=0))
  
      return output
  
file_path: deepchecks/deepchecks/vision/utils/detection_formatters.py
imports: from collections import Counter
  from typing import Iterable, List, Sequence, Tuple, Union
  import numpy
  from PIL.Image import Image
  from deepchecks.vision.vision_data.utils import is_torch_object
label_desc: Use image node_id 2 for calling a global function with example usage: convert_batch_of_bboxes(batch, notation) and returns: output