code: def get_affine_mat_kernel(h, w, s, inv=False):
      if w < h:
          w_ = s
          h_ = int(np.ceil((s / w * h) / 64.0) * 64)
          scale_w = w
          scale_h = h_ / w_ * w
  
      else:
          h_ = s
          w_ = int(np.ceil((s / h * w) / 64.0) * 64)
          scale_h = h
          scale_w = w_ / h_ * h
  
      center = np.array([np.round(w / 2.0), np.round(h / 2.0)])
  
      size_resized = (w_, h_)
      trans = get_affine_transform(
          center, np.array([scale_w, scale_h]), 0, size_resized, inv=inv
      )
  
      return trans, size_resized
  
file_path: PaddleDetection/deploy/python/keypoint_preprocess.py
imports: import cv2
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: get_affine_mat_kernel(h, w, s, inv) and returns: trans,  size_resized