code: def resize_image_min(im, max_side_len=512):
      """ """
      h, w, _ = im.shape
  
      resize_w = w
      resize_h = h
  
      if resize_h < resize_w:
          ratio = float(max_side_len) / resize_h
      else:
          ratio = float(max_side_len) / resize_w
  
      resize_h = int(resize_h * ratio)
      resize_w = int(resize_w * ratio)
  
      max_stride = 128
      resize_h = (resize_h + max_stride - 1) // max_stride * max_stride
      resize_w = (resize_w + max_stride - 1) // max_stride * max_stride
      im = cv2.resize(im, (int(resize_w), int(resize_h)))
      ratio_h = resize_h / float(h)
      ratio_w = resize_w / float(w)
      return im, (ratio_h, ratio_w)
  
file_path: PaddleOCR/ppocr/utils/e2e_utils/visual.py
imports: import numpy
  import cv2
  import time
label_desc: Use image node_id 2 for calling a global function with example usage: resize_image_min(im, max_side_len) and returns: im,  ratio_h,  ratio_w