code: def keypoints_distance(detected_pose, tracked_pose):
      # Use different distances for bounding boxes and keypoints
      if detected_pose.label != 0:
          detection_centroid = np.sum(
              detected_pose.points, axis=0
          ) / len(detected_pose.points)
          tracked_centroid = np.sum(
              tracked_pose.estimate, axis=0
          ) / len(detected_pose.points)
          distances = np.linalg.norm(
              detection_centroid - tracked_centroid, axis=0
          )
          return distances / (KEYPOINT_DIST_THRESHOLD + distances)
  
      else:
          distances = np.linalg.norm(
              detected_pose.points - tracked_pose.estimate, axis=1
          )
          match_num = np.count_nonzero(
              (distances < KEYPOINT_DIST_THRESHOLD)
              * (detected_pose.scores > DETECTION_THRESHOLD)
              * (
                  tracked_pose.last_detection.scores
                  > DETECTION_THRESHOLD
              )
          )
          return 1 / (1 + match_num)
  
file_path: norfair/demos/keypoints_bounding_boxes/src/demo.py
imports: import argparse
  import sys
  from typing import List, Optional, Union
  import cv2
  import numpy
  import torch
  import norfair
  from norfair import Detection, Tracker, Video
  from norfair.drawing import Color
label_desc: Use image node_id 2 for calling a global function with example usage: keypoints_distance(detected_pose, tracked_pose) and returns: unknown, unknown