def _load_annotations(self) -> Tuple[List[dict], List[dict]]:
        """Load data from annotations in COCO format."""
        num_keypoints = self.metainfo['num_keypoints']

        img_names = self.ann_data['imgname']
        num_imgs = len(img_names)

        if 'S' in self.ann_data.keys():
            kpts_3d = self.ann_data['S']
        else:
            kpts_3d = np.zeros((num_imgs, num_keypoints, 4), dtype=np.float32)

        if 'part' in self.ann_data.keys():
            kpts_2d = self.ann_data['part']
        else:
            kpts_2d = np.zeros((num_imgs, num_keypoints, 3), dtype=np.float32)

        if 'center' in self.ann_data.keys():
            centers = self.ann_data['center']
        else:
            centers = np.zeros((num_imgs, 2), dtype=np.float32)

        if 'scale' in self.ann_data.keys():
            scales = self.ann_data['scale'].astype(np.float32)
        else:
            scales = np.zeros(num_imgs, dtype=np.float32)

        instance_list = []
        image_list = []

        for idx, frame_ids in enumerate(self.sequence_indices):
            assert len(frame_ids) == self.seq_len

            _img_names = img_names[frame_ids]

            _keypoints = kpts_2d[frame_ids].astype(np.float32)
            keypoints = _keypoints[..., :2]
            keypoints_visible = _keypoints[..., 2]

            _keypoints_3d = kpts_3d[frame_ids].astype(np.float32)
            keypoints_3d = _keypoints_3d[..., :3]
            keypoints_3d_visible = _keypoints_3d[..., 3]

            target_idx = -1 if self.causal else int(self.seq_len) // 2

            instance_info = {
                'num_keypoints': num_keypoints,
                'keypoints': keypoints,
                'keypoints_visible': keypoints_visible,
                'keypoints_3d': keypoints_3d,
                'keypoints_3d_visible': keypoints_3d_visible,
                'scale': scales[idx],
                'center': centers[idx].astype(np.float32).reshape(1, -1),
                'id': idx,
                'category_id': 1,
                'iscrowd': 0,
                'img_paths': list(_img_names),
                'img_ids': frame_ids,
                'lifting_target': keypoints_3d[target_idx],
                'lifting_target_visible': keypoints_3d_visible[target_idx],
                'target_img_path': _img_names[target_idx],
            }

            if self.camera_param_file:
                _cam_param = self.get_camera_param(_img_names[0])
                instance_info['camera_param'] = _cam_param

            instance_list.append(instance_info)

        for idx, imgname in enumerate(img_names):
            img_info = self.get_img_info(idx, imgname)
            image_list.append(img_info)

        return instance_list, image_list
Load data from annotations in COCO format.
mmpose/mmpose/datasets/datasets/base/base_mocap_dataset.py