def predict(self,
                feats: Tuple[Tensor],
                batch_data_samples: OptSampleList,
                test_cfg: ConfigType = {}) -> Predictions:
        """Predict results from features.

        Args:
            feats (Tuple[Tensor] | List[Tuple[Tensor]]): The multi-stage
                features (or multiple multi-stage features in TTA)
            batch_data_samples (List[:obj:`PoseDataSample`]): The batch
                data samples
            test_cfg (dict): The runtime config for testing process. Defaults
                to {}

        Returns:
            Union[InstanceList | Tuple[InstanceList | PixelDataList]]: If
            posehead's ``test_cfg['output_heatmap']==True``, return both
            pose and heatmap prediction; otherwise only return the pose
            prediction.

            The pose prediction is a list of ``InstanceData``, each contains
            the following fields:

                - keypoints (np.ndarray): predicted keypoint coordinates in
                    shape (num_instances, K, D) where K is the keypoint number
                    and D is the keypoint dimension
                - keypoint_scores (np.ndarray): predicted keypoint scores in
                    shape (num_instances, K)
                - keypoint_visibility (np.ndarray): predicted keypoints
                    visibility in shape (num_instances, K)

            The heatmap prediction is a list of ``PixelData``, each contains
            the following fields:

                - heatmaps (Tensor): The predicted heatmaps in shape (K, h, w)
        """
        if test_cfg.get('flip_test', False):
            # TTA: flip test -> feats = [orig, flipped]
            assert isinstance(feats, list) and len(feats) == 2
            flip_indices = batch_data_samples[0].metainfo['flip_indices']
            _feats, _feats_flip = feats

            _batch_vis = self.vis_forward(_feats)
            _batch_vis_flip = flip_visibility(
                self.vis_forward(_feats_flip), flip_indices=flip_indices)
            batch_vis = (_batch_vis + _batch_vis_flip) * 0.5
        else:
            batch_vis = self.vis_forward(feats)  # (B, K, D)

        batch_vis.unsqueeze_(dim=1)  # (B, N, K, D)

        if not self.use_sigmoid:
            batch_vis = torch.sigmoid(batch_vis)

        batch_pose = self.pose_head.predict(feats, batch_data_samples,
                                            test_cfg)

        return self.integrate(batch_vis, batch_pose)
Predict results from features.

        Args:
            feats (Tuple[Tensor] | List[Tuple[Tensor]]): The multi-stage
                features (or multiple multi-stage features in TTA)
            batch_data_samples (List[:obj:`PoseDataSample`]): The batch
                data samples
            test_cfg (dict): The runtime config for testing process. Defaults
                to {}

        Returns:
            Union[InstanceList | Tuple[InstanceList | PixelDataList]]: If
            posehead's ``test_cfg['output_heatmap']==True``, return both
            pose and heatmap prediction; otherwise only return the pose
            prediction.

            The pose prediction is a list of ``InstanceData``, each contains
            the following fields:

                - keypoints (np.ndarray): predicted keypoint coordinates in
                    shape (num_instances, K, D) where K is the keypoint number
                    and D is the keypoint dimension
                - keypoint_scores (np.ndarray): predicted keypoint scores in
                    shape (num_instances, K)
                - keypoint_visibility (np.ndarray): predicted keypoints
                    visibility in shape (num_instances, K)

            The heatmap prediction is a list of ``PixelData``, each contains
            the following fields:

                - heatmaps (Tensor): The predicted heatmaps in shape (K, h, w)
        
mmpose/mmpose/models/heads/hybrid_heads/vis_head.py