code: def keypoint_epe(pred, gt, mask):
      """Calculate the end-point error.
  
      Note:
          - batch_size: N
          - num_keypoints: K
  
      Args:
          pred (np.ndarray[N, K, 2]): Predicted keypoint location.
          gt (np.ndarray[N, K, 2]): Groundtruth keypoint location.
          mask (np.ndarray[N, K]): Visibility of the target. False for invisible
              joints, and True for visible. Invisible joints will be ignored for
              accuracy calculation.
  
      Returns:
          float: Average end-point error.
      """
  
      normalize = np.ones(
          (pred.shape[0], pred.shape[2]), dtype=np.float32
      )
      distances = _calc_distances(pred, gt, mask, normalize)
      distance_valid = distances[distances != -1]
      return distance_valid.sum() / max(1, len(distance_valid))
  
imports: import cv2
  import numpy
  import paddle.nn.functional
label_desc: Use image node_id 20 for calling a global function with example usage: keypoint_epe(pred, gt, mask) and returns: unknown