code: def keypoint_detection(
      img, detector, pose_net, ctx=mx.cpu(), axes=None
  ):
      x, img = gcv.data.transforms.presets.yolo.transform_test(
          img, short=512, max_size=350
      )
      x = x.as_in_context(ctx)
      class_IDs, scores, bounding_boxs = detector(x)
  
      plt.cla()
      pose_input, upscale_bbox = detector_to_alpha_pose(
          img,
          class_IDs,
          scores,
          bounding_boxs,
          output_shape=(128, 96),
          ctx=ctx,
      )
      if len(upscale_bbox) > 0:
          predicted_heatmap = pose_net(pose_input)
          pred_coords, confidence = heatmap_to_coord_alpha_pose(
              predicted_heatmap, upscale_bbox
          )
  
          axes = plot_keypoints(
              img,
              pred_coords,
              confidence,
              class_IDs,
              bounding_boxs,
              scores,
              box_thresh=0.5,
              keypoint_thresh=0.2,
              ax=axes,
          )
          plt.draw()
          plt.pause(0.001)
      else:
          axes = plot_image(frame, ax=axes)
          plt.draw()
          plt.pause(0.001)
  
      return axes
  
file_path: gluon-cv/scripts/pose/alpha_pose/cam_demo.py
imports: from __future__ import division
  import argparse, time, logging, os, math, tqdm, cv2
  import numpy
  import mxnet
  from mxnet import gluon, nd, image
  from mxnet.gluon.data.vision import transforms
  import matplotlib.pyplot
  import gluoncv
  from gluoncv import data
  from gluoncv.data import mscoco
  from gluoncv.model_zoo import get_model
  from gluoncv.data.transforms.pose import detector_to_alpha_pose, heatmap_to_coord_alpha_pose
  from gluoncv.utils.viz import plot_image, plot_keypoints
label_desc: Use image node_id 1 for calling a global function with example usage: keypoint_detection(img, detector, pose_net, ctx, axes) and returns: axes