class_docstr: MPII dataset for topdown pose estimation.
  
  The dataset loads raw features and apply specified transforms
  to return a dict containing the image tensors and other information.
  
  MPII keypoint indexes::
  
      0: 'right_ankle',
      1: 'right_knee',
      2: 'right_hip',
      3: 'left_hip',
      4: 'left_knee',
      5: 'left_ankle',
      6: 'pelvis',
      7: 'thorax',
      8: 'upper_neck',
      9: 'head_top',
      10: 'right_wrist',
      11: 'right_elbow',
      12: 'right_shoulder',
      13: 'left_shoulder',
      14: 'left_elbow',
      15: 'left_wrist',
  
  Args:
      dataset_dir (str): Root path to the dataset.
      image_dir (str): Path to a directory where images are held.
      anno_path (str): Relative path to the annotation file.
      num_joints (int): Keypoint numbers
      trainsize (list):[w, h] Image target size
      transform (composed(operators)): A sequence of data transforms.
code: def parse_dataset(self):
      with open(self.get_anno()) as anno_file:
          anno = json.load(anno_file)
  
      gt_db = []
      for a in anno:
          image_name = a["image"]
          im_id = (
              a["image_id"]
              if "image_id" in a
              else int(os.path.splitext(image_name)[0])
          )
  
          c = np.array(a["center"], dtype=np.float32)
          s = np.array([a["scale"], a["scale"]], dtype=np.float32)
  
          # Adjust center/scale slightly to avoid cropping limbs
          if c[0] != -1:
              c[1] = c[1] + 15 * s[1]
              s = s * 1.25
          c = c - 1
  
          joints = np.zeros(
              (self.ann_info["num_joints"], 3), dtype=np.float32
          )
          joints_vis = np.zeros(
              (self.ann_info["num_joints"], 3), dtype=np.float32
          )
          if "gt_joints" in a:
              joints_ = np.array(a["gt_joints"])
              joints_[:, 0:2] = joints_[:, 0:2] - 1
              joints_vis_ = np.array(a["joints_vis"])
              assert (
                  len(joints_) == self.ann_info["num_joints"]
              ), "joint num diff: {} vs {}".format(
                  len(joints_), self.ann_info["num_joints"]
              )
  
              joints[:, 0:2] = joints_[:, 0:2]
              joints_vis[:, 0] = joints_vis_[:]
              joints_vis[:, 1] = joints_vis_[:]
  
          gt_db.append(
              {
                  "image_file": os.path.join(
                      self.img_prefix, image_name
                  ),
                  "im_id": im_id,
                  "center": c,
                  "scale": s,
                  "gt_joints": joints,
                  "joints_vis": joints_vis,
              }
          )
      print("number length: {}".format(len(gt_db)))
      self.db = gt_db
  
imports: import os
  import cv2
  import numpy
  import json
  import copy
  import pycocotools
  from pycocotools.coco import COCO
  from .dataset import DetDataset
  from ppdet.core.workspace import register, serializable
label_desc: Use image node_id 2 for calling the KeypointTopDownMPIIDataset obj's underlying member method code with example usage: obj.parse_dataset() without return types