docstr: Resize the image numpy.
          
code: def apply(self, sample, context=None):
      """Resize the image numpy."""
      im = sample["image"]
      h, w = sample["im_shape"]
      if not isinstance(im, np.ndarray):
          raise TypeError("{}: image type is not numpy.".format(self))
      if len(im.shape) != 3:
          from PIL import UnidentifiedImageError
  
          raise UnidentifiedImageError(
              "{}: image is not 3-dimensional.".format(self)
          )
  
      # apply image
      height, width = self.target_size
      img, ratio, padw, padh = self.apply_image(
          im, height=height, width=width
      )
  
      sample["image"] = img
      new_shape = (round(h * ratio), round(w * ratio))
      sample["im_shape"] = np.asarray(new_shape, dtype=np.float32)
      sample["scale_factor"] = np.asarray(
          [ratio, ratio], dtype=np.float32
      )
  
      # apply bbox
      if "gt_bbox" in sample and len(sample["gt_bbox"]) > 0:
          sample["gt_bbox"] = self.apply_bbox(
              sample["gt_bbox"], h, w, ratio, padw, padh
          )
      return sample
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from numbers import Integral
  import cv2
  import copy
  import numpy
  import random
  import math
  from .operators import BaseOperator, register_op
  from .batch_operators import Gt2TTFTarget
  from ppdet.modeling.bbox_utils import bbox_iou_np_expand
  from ppdet.utils.logger import setup_logger
  from .op_helper import gaussian_radius
label_desc: Use image node_id 4 for calling the LetterBoxResize obj's underlying member method code with example usage: obj.apply(sample, context) and returns: sample