code: def landmark_transform(ex_rois, gt_rois):
      assert (
          ex_rois.shape[0] == gt_rois.shape[0]
      ), "inconsistent rois number"
  
      ex_widths = ex_rois[:, 2] - ex_rois[:, 0] + 1.0
      ex_heights = ex_rois[:, 3] - ex_rois[:, 1] + 1.0
      ex_ctr_x = ex_rois[:, 0] + 0.5 * (ex_widths - 1.0)
      ex_ctr_y = ex_rois[:, 1] + 0.5 * (ex_heights - 1.0)
  
      targets = []
      for i in range(gt_rois.shape[1]):
          for j in range(gt_rois.shape[2]):
              # if not config.USE_OCCLUSION and j==2:
              #  continue
              if j == 2:
                  continue
              if j == 0:  # w
                  target = (gt_rois[:, i, j] - ex_ctr_x) / (
                      ex_widths + 1e-14
                  )
              elif j == 1:  # h
                  target = (gt_rois[:, i, j] - ex_ctr_y) / (
                      ex_heights + 1e-14
                  )
              else:  # visibile
                  target = gt_rois[:, i, j]
              targets.append(target)
  
      targets = np.vstack(targets).transpose()
      return targets
  
file_path: insightface/detection/retinaface_anticov/rcnn/processing/bbox_transform.py
imports: import numpy
  from ..cython.bbox import bbox_overlaps_cython
label_desc: Use image node_id 5 for calling a global function with example usage: landmark_transform(ex_rois, gt_rois) and returns: targets