code: def get_shrink(height, width):
      """
      Args:
          height (int): image height.
          width (int): image width.
      """
      # avoid out of memory
      max_shrink_v1 = (0x7FFFFFFF / 577.0 / (height * width)) ** 0.5
      max_shrink_v2 = (
          (678 * 1024 * 2.0 * 2.0) / (height * width)
      ) ** 0.5
  
      def get_round(x, loc):
          str_x = str(x)
          if "." in str_x:
              str_before, str_after = str_x.split(".")
              len_after = len(str_after)
              if len_after >= 3:
                  str_final = str_before + "." + str_after[0:loc]
                  return float(str_final)
              else:
                  return x
  
      max_shrink = get_round(min(max_shrink_v1, max_shrink_v2), 2) - 0.3
      if max_shrink >= 1.5 and max_shrink < 2:
          max_shrink = max_shrink - 0.1
      elif max_shrink >= 2 and max_shrink < 3:
          max_shrink = max_shrink - 0.2
      elif max_shrink >= 3 and max_shrink < 4:
          max_shrink = max_shrink - 0.3
      elif max_shrink >= 4 and max_shrink < 5:
          max_shrink = max_shrink - 0.4
      elif max_shrink >= 5:
          max_shrink = max_shrink - 0.5
      elif max_shrink <= 0.1:
          max_shrink = 0.1
  
      shrink = max_shrink if max_shrink < 1 else 1
      return shrink, max_shrink
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import cv2
  import numpy
  from collections import OrderedDict
  import paddle
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 8 for calling a global function with example usage: get_shrink(height, width) and returns: shrink,  max_shrink, float, x