code: def extract_crops(
      img: np.ndarray, boxes: np.ndarray, channels_last: bool = True
  ) -> List[np.ndarray]:
      """Created cropped images from list of bounding boxes
  
      Args:
      ----
          img: input image
          boxes: bounding boxes of shape (N, 4) where N is the number of boxes, and the relative
              coordinates (xmin, ymin, xmax, ymax)
          channels_last: whether the channel dimensions is the last one instead of the last one
  
      Returns:
      -------
          list of cropped images
      """
      if boxes.shape[0] == 0:
          return []
      if boxes.shape[1] != 4:
          raise AssertionError(
              "boxes are expected to be relative and in order (xmin, ymin, xmax, ymax)"
          )
  
      # Project relative coordinates
      _boxes = boxes.copy()
      h, w = img.shape[:2] if channels_last else img.shape[-2:]
      if not np.issubdtype(_boxes.dtype, np.integer):
          _boxes[:, [0, 2]] *= w
          _boxes[:, [1, 3]] *= h
          _boxes = _boxes.round().astype(int)
          # Add last index
          _boxes[2:] += 1
      if channels_last:
          return deepcopy(
              [img[box[1] : box[3], box[0] : box[2]] for box in _boxes]
          )
  
      return deepcopy(
          [img[:, box[1] : box[3], box[0] : box[2]] for box in _boxes]
      )
  
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 13 for calling a global function with example usage: extract_crops(img, boxes, channels_last) and returns: deepcopy, list, deepcopy