code: def nms_oks(kp_predictions, rois, thresh):
      """Nms based on kp predictions."""
      scores = np.mean(kp_predictions[:, 2, :], axis=1)
      order = scores.argsort()[::-1]
  
      keep = []
      while order.size > 0:
          i = order[0]
          keep.append(i)
          ovr = compute_oks(
              kp_predictions[i],
              rois[i],
              kp_predictions[order[1:]],
              rois[order[1:]],
          )
          inds = np.where(ovr <= thresh)[0]
          order = order[inds + 1]
  
      return keep
  
file_path: dense-pose/detectron/utils/keypoints.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import cv2
  import numpy
  from detectron.core.config import cfg
  import detectron.utils.blob
label_desc: Use image node_id 8 for calling a global function with example usage: nms_oks(kp_predictions, rois, thresh) and returns: keep