code: def polygon_to_bbox(polygon: Polygon4P) -> BoundingBox:
      """Convert a polygon to a bounding box
  
      Args:
      ----
          polygon: a polygon
  
      Returns:
      -------
          a bounding box
      """
      x, y = zip(*polygon)
      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 2 for calling a global function with example usage: polygon_to_bbox(polygon) and returns: min,  min,  max,  max