class_docstr: Base class for top_down datasets.
  
  All datasets should subclass it.
  All subclasses should overwrite:
      Methods:`_get_db`
  
  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
      transform (composed(operators)): A sequence of data transforms.
docstr: Prepare sample for training given the index.
docstr_tok: ["Prepare","sample","for","training","given","the","index","."]
code: def __getitem__(self, idx):
      """Prepare sample for training given the index."""
      records = copy.deepcopy(self.db[idx])
      records["image"] = cv2.imread(
          records["image_file"],
          cv2.IMREAD_COLOR | cv2.IMREAD_IGNORE_ORIENTATION,
      )
      records["image"] = cv2.cvtColor(
          records["image"], cv2.COLOR_BGR2RGB
      )
      records["score"] = records["score"] if "score" in records else 1
      records = self.transform(records)
      # print('records', records)
      return records
  
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 4 for calling the KeypointTopDownBaseDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: records