code: def kps2distance(points, kps, max_dis=None, eps=0.1):
      """Decode bounding box based on distances.
  
      Args:
          points (Tensor): Shape (n, 2), [x, y].
          kps (Tensor): Shape (n, K), "xyxy" format
          max_dis (float): Upper bound of the distance.
          eps (float): a small value to ensure target < max_dis, instead <=
  
      Returns:
          Tensor: Decoded distances.
      """
  
      preds = []
      for i in range(0, kps.shape[1], 2):
          px = kps[:, i] - points[:, i % 2]
          py = kps[:, i + 1] - points[:, i % 2 + 1]
          if max_dis is not None:
              px = px.clamp(min=0, max=max_dis - eps)
              py = py.clamp(min=0, max=max_dis - eps)
          preds.append(px)
          preds.append(py)
      return torch.stack(preds, -1)
  
file_path: insightface/detection/scrfd/mmdet/core/bbox/transforms.py
imports: import numpy
  import torch
label_desc: Use image node_id 10 for calling a global function with example usage: kps2distance(points, kps, max_dis, eps) and returns: torch