code: def yolo_correct_boxes(box_xy, box_wh, input_shape, image_shape):
      """Get corrected boxes"""
      box_yx = box_xy[..., ::-1]
      box_hw = box_wh[..., ::-1]
      input_shape = K.cast(input_shape, K.dtype(box_yx))
      image_shape = K.cast(image_shape, K.dtype(box_yx))
      new_shape = K.round(
          image_shape * K.min(input_shape / image_shape)
      )
      offset = (input_shape - new_shape) / 2.0 / input_shape
      scale = input_shape / new_shape
      box_yx = (box_yx - offset) * scale
      box_hw *= scale
  
      box_mins = box_yx - (box_hw / 2.0)
      box_maxes = box_yx + (box_hw / 2.0)
      boxes = K.concatenate(
          [
              box_mins[..., 0:1],  # y_min
              box_mins[..., 1:2],  # x_min
              box_maxes[..., 0:1],  # y_max
              box_maxes[..., 1:2],  # x_max
          ]
      )
  
      # Scale boxes back to original image shape.
      boxes *= K.concatenate([image_shape, image_shape])
      return boxes
  
file_path: MMdnn/mmdnn/conversion/examples/keras/utils.py
imports: import tensorflow
  from keras import backend
  from PIL import Image
label_desc: Use image node_id 3 for calling a global function with example usage: yolo_correct_boxes(box_xy, box_wh, input_shape, image_shape) and returns: boxes