code: def close_kpt_nms(boxlist, dis_thresh=1.0, close_kpt_thresh=5):
      """
      greedily select boxes with high confidence and overlap with current maximum <= thresh
      rule out overlap >= thresh, overlap = oks
      :param kpts_db
      :param thresh: retain overlap < thresh
      :return: indexes to keep
      """
      if len(boxlist) == 0:
          return boxlist
  
      kpts = (
          boxlist.pred_keypoints.reshape(len(boxlist), -1).cpu().numpy()
      )
  
      # scores = boxlist.scores
      # order = scores.argsort()[::-1]
      order = np.arange(0, len(boxlist))
  
      keep = []
      while len(order) > 0:
          i = order[0]
          keep.append(i)
  
          close_kpt_num = get_close_kpt_num(
              kpts[i], kpts[order[1:]], dis_thresh
          )
  
          inds = np.where(close_kpt_num <= close_kpt_thresh)[0]
          order = order[inds + 1]
  
      return boxlist[keep]
  
file_path: gluon-cv/gluoncv/torch/nn/nms.py
imports: import numpy
  import torch
  from torchvision.ops import boxes
  from torchvision.ops import nms
label_desc: Use image node_id 6 for calling a global function with example usage: close_kpt_nms(boxlist, dis_thresh, close_kpt_thresh) and returns: boxlist, boxlist