code: def letterbox(img_orig, h, w):
      """
      Input image is pre-processed before passing it to the network in YoloV2. This function applies the pre-processing to input image.
  
      Args:
          img_orig: Input image
          w : Desired width of output image after pre-processing. Should be a multiple of 32.
          h : Desired height of output image after pre-processing. Should be a multiple of 32.
      """
      assert img_orig.dtype == np.uint8
      im_h, im_w, _ = img_orig.shape
      if (w * 1.0 / im_w) < (h * 1.0 / im_h):
          new_w = w
          new_h = int((im_h * w) / im_w)
      else:
          new_h = h
          new_w = int((im_w * h) / im_h)
  
      patch = imresize(img_orig, (new_w, new_h))
      img = np.ones((h, w, 3), np.uint8) * 127
      # resize
      x0 = int((w - new_w) / 2)
      y0 = int((h - new_h) / 2)
      img[y0 : y0 + new_h, x0 : x0 + new_w] = patch
      return img, new_w, new_h
  
file_path: nnabla/python/src/nnabla/models/object_detection/utils.py
imports: import numpy
  from nnabla.models.object_detection.draw_utils import DrawBoundingBoxes
  from nnabla.utils.image_utils import imresize
label_desc: Use image node_id 3 for calling a global function with example usage: letterbox(img_orig, h, w) and returns: img,  new_w,  new_h