def parse_data_info(self, raw_data_info: dict) -> Optional[dict]:
        """Parse raw annotation of an instance.

        Args:
            raw_data_info (dict): Raw data information loaded from
                ``ann_file``. It should have following contents:

                - ``'raw_ann_info'``: Raw annotation of an instance
                - ``'raw_img_info'``: Raw information of the image that
                    contains the instance

        Returns:
            dict: Parsed instance annotation
        """

        ann = raw_data_info['raw_ann_info']
        img = raw_data_info['raw_img_info']

        # filter invalid instance
        if 'bbox' not in ann or 'keypoints' not in ann or max(
                ann['keypoints']) == 0:
            return None

        img_w, img_h = img['width'], img['height']
        # get the bbox of the center frame
        # get bbox in shape [1, 4], formatted as xywh
        x, y, w, h = ann['bbox']
        x1 = np.clip(x, 0, img_w - 1)
        y1 = np.clip(y, 0, img_h - 1)
        x2 = np.clip(x + w, 0, img_w - 1)
        y2 = np.clip(y + h, 0, img_h - 1)

        bbox = np.array([x1, y1, x2, y2], dtype=np.float32).reshape(1, 4)

        # get the keypoints of the center frame
        # keypoints in shape [1, K, 2] and keypoints_visible in [1, K]
        _keypoints = np.array(
            ann['keypoints'], dtype=np.float32).reshape(1, -1, 3)
        keypoints = _keypoints[..., :2]
        keypoints_visible = np.minimum(1, _keypoints[..., 2])

        # deal with multiple image paths
        img_paths: list = []
        # get the image path of the center frame
        center_img_path = osp.join(self.data_prefix['img'], img['file_name'])
        # append the center image path first
        img_paths.append(center_img_path)

        # select the frame indices
        if self.frame_sampler_mode == 'fixed':
            indices = self.frame_indices
        else:  # self.frame_sampler_mode == 'random':
            low, high = self.frame_range
            indices = np.random.randint(low, high + 1, self.num_sampled_frame)

        nframes = int(img['nframes'])
        file_name = img['file_name']
        ref_idx = int(osp.splitext(osp.basename(file_name))[0])

        for idx in indices:
            if self.test_mode and idx == 0:
                continue
            # the supporting frame index
            support_idx = ref_idx + idx
            # clip the frame index to make sure that it does not exceed
            # the boundings of frame indices
            support_idx = np.clip(support_idx, 0, nframes - 1)
            sup_img_path = osp.join(
                osp.dirname(center_img_path),
                str(support_idx).zfill(self.ph_fill_len) + '.jpg')

            img_paths.append(sup_img_path)

        data_info = {
            'img_id': int(img['frame_id']),
            'img_path': img_paths,
            'bbox': bbox,
            'bbox_score': np.ones(1, dtype=np.float32),
            'num_keypoints': ann['num_keypoints'],
            'keypoints': keypoints,
            'keypoints_visible': keypoints_visible,
            'frame_weights': self.frame_weights,
            'id': ann['id'],
        }

        return data_info
Parse raw annotation of an instance.

        Args:
            raw_data_info (dict): Raw data information loaded from
                ``ann_file``. It should have following contents:

                - ``'raw_ann_info'``: Raw annotation of an instance
                - ``'raw_img_info'``: Raw information of the image that
                    contains the instance

        Returns:
            dict: Parsed instance annotation
        
mmpose/mmpose/datasets/datasets/body/posetrack18_video_dataset.py