code: def adjust_box(
      xmin: float,
      ymin: float,
      w: float,
      h: float,
      fixed_size: Tuple[float, float],
  ):
      """通过增加w或者h的方式保证输入图片的长宽比固定"""
      xmax = xmin + w
      ymax = ymin + h
  
      hw_ratio = fixed_size[0] / fixed_size[1]
      if h / w > hw_ratio:
          # 需要在w方向padding
          wi = h / hw_ratio
          pad_w = (wi - w) / 2
          xmin = xmin - pad_w
          xmax = xmax + pad_w
      else:
          # 需要在h方向padding
          hi = w * hw_ratio
          pad_h = (hi - h) / 2
          ymin = ymin - pad_h
          ymax = ymax + pad_h
  
      return xmin, ymin, xmax, ymax
  
imports: import math
  import random
  from typing import Tuple
  import cv2
  import numpy
  import torch
  from torchvision.transforms import functional
  import matplotlib.pyplot
label_desc: Use image node_id 8 for calling a global function with example usage: adjust_box(xmin, ymin, w, h, fixed_size) and returns: xmin,  ymin,  xmax,  ymax