code: def im_detect_keypoints(model, im_scale, boxes):
      """Infer instance keypoint poses. This function must be called after
      im_detect_bbox as it assumes that the Caffe2 workspace is already populated
      with the necessary blobs.
  
      Arguments:
          model (DetectionModelHelper): the detection model to use
          im_scales (list): image blob scales as returned by im_detect_bbox
          boxes (ndarray): R x 4 array of bounding box detections (e.g., as
              returned by im_detect_bbox)
  
      Returns:
          pred_heatmaps (ndarray): R x J x M x M array of keypoint location
              logits (softmax inputs) for each of the J keypoint types output
              by the network (must be processed by keypoint_results to convert
              into point predictions in the original image coordinate space)
      """
      M = cfg.KRCNN.HEATMAP_SIZE
      if boxes.shape[0] == 0:
          pred_heatmaps = np.zeros(
              (0, cfg.KRCNN.NUM_KEYPOINTS, M, M), np.float32
          )
          return pred_heatmaps
  
      inputs = {"keypoint_rois": _get_rois_blob(boxes, im_scale)}
  
      # Add multi-level rois for FPN
      if cfg.FPN.MULTILEVEL_ROIS:
          _add_multilevel_rois_for_test(inputs, "keypoint_rois")
  
      for k, v in inputs.items():
          workspace.FeedBlob(core.ScopedName(k), v)
      workspace.RunNet(model.keypoint_net.Proto().name)
  
      pred_heatmaps = workspace.FetchBlob(
          core.ScopedName("kps_score")
      ).squeeze()
  
      # In case of 1
      if pred_heatmaps.ndim == 3:
          pred_heatmaps = np.expand_dims(pred_heatmaps, axis=0)
  
      return pred_heatmaps
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  from collections import defaultdict
  import cv2
  import logging
  import numpy
  from caffe2.python import core
  from caffe2.python import workspace
  import pycocotools.mask
  from detectron.core.config import cfg
  from detectron.utils.timer import Timer
  import detectron.core.test_retinanet
  import detectron.modeling.FPN
  import detectron.utils.blob
  import detectron.utils.boxes
  import detectron.utils.image
  import detectron.utils.keypoints
label_desc: Use image node_id 13 for calling a global function with example usage: im_detect_keypoints(model, im_scale, boxes) and returns: pred_heatmaps, pred_heatmaps