code: def remap_boxes(
      loc_preds: np.ndarray,
      orig_shape: Tuple[int, int],
      dest_shape: Tuple[int, int],
  ) -> np.ndarray:
      """Remaps a batch of rotated locpred (N, 4, 2) expressed for an origin_shape to a destination_shape.
      This does not impact the absolute shape of the boxes, but allow to calculate the new relative RotatedBbox
      coordinates after a resizing of the image.
  
      Args:
      ----
          loc_preds: (N, 4, 2) array of RELATIVE loc_preds
          orig_shape: shape of the origin image
          dest_shape: shape of the destination image
  
      Returns:
      -------
          A batch of rotated loc_preds (N, 4, 2) expressed in the destination referencial
      """
      if len(dest_shape) != 2:
          raise ValueError(
              f"Mask length should be 2, was found at: {len(dest_shape)}"
          )
      if len(orig_shape) != 2:
          raise ValueError(
              f"Image_shape length should be 2, was found at: {len(orig_shape)}"
          )
      orig_height, orig_width = orig_shape
      dest_height, dest_width = dest_shape
      mboxes = loc_preds.copy()
      mboxes[:, :, 0] = (
          (loc_preds[:, :, 0] * orig_width)
          + (dest_width - orig_width) / 2
      ) / dest_width
      mboxes[:, :, 1] = (
          (loc_preds[:, :, 1] * orig_height)
          + (dest_height - orig_height) / 2
      ) / dest_height
  
      return mboxes
  
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 8 for calling a global function with example usage: remap_boxes(loc_preds, orig_shape, dest_shape) and returns: mboxes