code: def resolve_enclosing_bbox(
      bboxes: Union[List[BoundingBox], np.ndarray]
  ) -> Union[BoundingBox, np.ndarray]:
      """Compute enclosing bbox either from:
  
      Args:
      ----
          bboxes: boxes in one of the following formats:
  
              - an array of boxes: (*, 5), where boxes have this shape:
              (xmin, ymin, xmax, ymax, score)
  
              - a list of BoundingBox
  
      Returns:
      -------
          a (1, 5) array (enclosing boxarray), or a BoundingBox
      """
      if isinstance(bboxes, np.ndarray):
          xmin, ymin, xmax, ymax, score = np.split(bboxes, 5, axis=1)
          return np.array(
              [
                  xmin.min(),
                  ymin.min(),
                  xmax.max(),
                  ymax.max(),
                  score.mean(),
              ]
          )
      else:
          x, y = zip(*[point for box in bboxes for point in box])
          return (min(x), min(y)), (max(x), max(y))
  
file_path: doctr/doctr/utils/geometry.py
imports: from copy import deepcopy
  from math import ceil
  from typing import List, Optional, Tuple, Union
  import cv2
  import numpy
  from .common_types import BoundingBox, Polygon4P
label_desc: Use image node_id 3 for calling a global function with example usage: resolve_enclosing_bbox(bboxes) and returns: np, min,  min,  max,  max