code: def distance2kps(points, distance, max_shape=None):
      """Decode distance prediction to bounding box.
  
      Args:
          points (Tensor): Shape (n, 2), [x, y].
          distance (Tensor): Distance from the given point to 4
              boundaries (left, top, right, bottom).
          max_shape (tuple): Shape of the image.
  
      Returns:
          Tensor: Decoded bboxes.
      """
      preds = []
      for i in range(0, distance.shape[1], 2):
          px = points[:, i % 2] + distance[:, i]
          py = points[:, i % 2 + 1] + distance[:, i + 1]
          if max_shape is not None:
              px = px.clamp(min=0, max=max_shape[1])
              py = py.clamp(min=0, max=max_shape[0])
          preds.append(px)
          preds.append(py)
      return np.stack(preds, axis=-1)
  
file_path: insightface/python-package/insightface/model_zoo/retinaface.py
imports: from __future__ import division
  import datetime
  import numpy
  import onnx
  import onnxruntime
  import os
  import os.path
  import cv2
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: distance2kps(points, distance, max_shape) and returns: np