def setUp(self):
        """Setup variables used in every test method."""
        self.batch_size = 8
        num_keypoints = 15
        self.data_batch = []
        self.data_samples = []

        for i in range(self.batch_size):
            gt_instances = InstanceData()
            keypoints = np.random.random((1, num_keypoints, 3))
            gt_instances.lifting_target = np.random.random((num_keypoints, 3))
            gt_instances.lifting_target_visible = np.ones(
                (num_keypoints, 1)).astype(bool)

            pred_instances = InstanceData()
            pred_instances.keypoints = keypoints + np.random.normal(
                0, 0.01, keypoints.shape)

            data = {'inputs': None}
            data_sample = PoseDataSample(
                gt_instances=gt_instances, pred_instances=pred_instances)
            data_sample.set_metainfo(
                dict(target_img_path='tests/data/h36m/S7/'
                     'S7_Greeting.55011271/S7_Greeting.55011271_000396.jpg'))

            self.data_batch.append(data)
            self.data_samples.append(data_sample.to_dict())
Setup variables used in every test method.
mmpose/tests/test_evaluation/test_metrics/test_keypoint_3d_metrics.py