def process(self, data_batch: Sequence[dict],
                data_samples: Sequence[dict]) -> None:
        """Split data samples by partitions, then call metric.process part by
        part."""
        parted_data_samples = {
            partition_name: []
            for partition_name in self.partitions.keys()
        }
        for data_sample in data_samples:
            for partition_name, keypoint_ids in self.partitions.items():
                _data_sample = deepcopy(data_sample)
                if 'keypoint_scores' in _data_sample['pred_instances']:
                    _data_sample['pred_instances'][
                        'keypoint_scores'] = _data_sample['pred_instances'][
                            'keypoint_scores'][:, keypoint_ids]
                _data_sample['pred_instances']['keypoints'] = _data_sample[
                    'pred_instances']['keypoints'][:, keypoint_ids]
                _data_sample['gt_instances']['keypoints'] = _data_sample[
                    'gt_instances']['keypoints'][:, keypoint_ids]
                _data_sample['gt_instances'][
                    'keypoints_visible'] = _data_sample['gt_instances'][
                        'keypoints_visible'][:, keypoint_ids]

                # for coco metric
                if 'raw_ann_info' in _data_sample:
                    raw_ann_info = _data_sample['raw_ann_info']
                    anns = raw_ann_info if isinstance(
                        raw_ann_info, list) else [raw_ann_info]
                    for ann in anns:
                        if 'keypoints' in ann:
                            keypoints = np.array(ann['keypoints']).reshape(
                                -1, 3)
                            keypoints = keypoints[keypoint_ids]
                            num_keypoints = np.sum(keypoints[:, 2] > 0)
                            ann['keypoints'] = keypoints.flatten().tolist()
                            ann['num_keypoints'] = num_keypoints

                parted_data_samples[partition_name].append(_data_sample)

        for partition_name, metric in self.metrics.items():
            metric.process(data_batch, parted_data_samples[partition_name])
Split data samples by partitions, then call metric.process part by
        part.
mmpose/mmpose/evaluation/metrics/keypoint_partition_metric.py