code: def estimate_trans_bbox(face, input_size, s=2.0):
      w = face[2] - face[0]
      h = face[3] - face[1]
      wc = int((face[2] + face[0]) / 2)
      hc = int((face[3] + face[1]) / 2)
      im_size = max(w, h)
      # size = int(im_size*1.2)
      scale = input_size / (max(w, h) * s)
      M = [
          [scale, 0, input_size / 2 - wc * scale],
          [0, scale, input_size / 2 - hc * scale],
      ]
      M = np.array(M)
      return M
  
file_path: insightface/alignment/heatmap/img_helper.py
imports: import numpy
  import math
  import cv2
  from skimage import transform
label_desc: Use image node_id 4 for calling a global function with example usage: estimate_trans_bbox(face, input_size, s) and returns: M