code: def correct_yolo_boxes(boxes, image_h, image_w, net_h, net_w):
      if (float(net_w) / image_w) < (float(net_h) / image_h):
          new_w = net_w
          new_h = (image_h * net_w) / image_w
      else:
          new_h = net_w
          new_w = (image_w * net_h) / image_h
  
      for i in range(len(boxes)):
          x_offset, x_scale = (net_w - new_w) / 2.0 / net_w, float(
              new_w
          ) / net_w
          y_offset, y_scale = (net_h - new_h) / 2.0 / net_h, float(
              new_h
          ) / net_h
  
          boxes[i].xmin = int(
              (boxes[i].xmin - x_offset) / x_scale * image_w
          )
          boxes[i].xmax = int(
              (boxes[i].xmax - x_offset) / x_scale * image_w
          )
          boxes[i].ymin = int(
              (boxes[i].ymin - y_offset) / y_scale * image_h
          )
          boxes[i].ymax = int(
              (boxes[i].ymax - y_offset) / y_scale * image_h
          )
  
file_path: ImageAI/imageai_tf_deprecated/Detection/Custom/utils/utils.py
imports: import cv2
  import numpy
  import os
  from .bbox import BoundBox, bbox_iou
  from scipy.special import expit
label_desc: Use image node_id 4 for calling a global function with example usage: correct_yolo_boxes(boxes, image_h, image_w, net_h, net_w) without return types