code: def estimate_norm(lmk, image_size=112, mode="arcface"):
      assert lmk.shape == (5, 2)
      tform = trans.SimilarityTransform()
      lmk_tran = np.insert(lmk, 2, values=np.ones(5), axis=1)
      min_M = []
      min_index = []
      min_error = float("inf")
      if mode == "arcface":
          assert image_size == 112
          src = arcface_src
      else:
          src = src_map[image_size]
      for i in np.arange(src.shape[0]):
          tform.estimate(lmk, src[i])
          M = tform.params[0:2, :]
          results = np.dot(M, lmk_tran.T)
          results = results.T
          error = np.sum(
              np.sqrt(np.sum((results - src[i]) ** 2, axis=1))
          )
          #         print(error)
          if error < min_error:
              min_error = error
              min_M = M
              min_index = i
      return min_M, min_index
  
imports: import cv2
  import numpy
  from skimage import transform
label_desc: Use image node_id 1 for calling a global function with example usage: estimate_norm(lmk, image_size, mode) and returns: min_M,  min_index