docstr: resize image to a size multiple of 32 which is required by the network
  args:
      img(array): array with shape [h, w, c]
  return(tuple):
      img, (ratio_h, ratio_w)
docstr_tok: ["resize","image","to","a","size","multiple","of","32","which","is","required","by","the","network","args",":","img","(","array",")",":","array","with","shape","[","h",",","w",",","c","]","return","(","tuple",")",":","img",",","(","ratio_h",",","ratio_w",")"]
code: def resize_image_type0(self, img):
      """
      resize image to a size multiple of 32 which is required by the network
      args:
          img(array): array with shape [h, w, c]
      return(tuple):
          img, (ratio_h, ratio_w)
      """
      limit_side_len = self.limit_side_len
      h, w, _ = img.shape
  
      # limit the max side
      if self.limit_type == "max":
          if max(h, w) > limit_side_len:
              if h > w:
                  ratio = float(limit_side_len) / h
              else:
                  ratio = float(limit_side_len) / w
          else:
              ratio = 1.0
      else:
          if min(h, w) < limit_side_len:
              if h < w:
                  ratio = float(limit_side_len) / h
              else:
                  ratio = float(limit_side_len) / w
          else:
              ratio = 1.0
      resize_h = int(h * ratio)
      resize_w = int(w * ratio)
  
      resize_h = int(round(resize_h / 32) * 32)
      resize_w = int(round(resize_w / 32) * 32)
  
      try:
          if int(resize_w) <= 0 or int(resize_h) <= 0:
              return None, (None, None)
          img = cv2.resize(img, (int(resize_w), int(resize_h)))
      except:
          print(img.shape, resize_w, resize_h)
          sys.exit(0)
      ratio_h = resize_h / float(h)
      ratio_w = resize_w / float(w)
      # return img, np.array([h, w])
      return img, [ratio_h, ratio_w]
  
imports: import cv2
  import copy
  import numpy
  import math
  import re
  import sys
  import argparse
  import string
  from copy import deepcopy
  from argparse import ArgumentParser, RawDescriptionHelpFormatter
  import yaml
label_desc: Use image node_id 4 for calling the DetResizeForTest obj's underlying member method code with example usage: obj.resize_image_type0(img) and returns: img,  list, None,  None,  None