def _post_process(keypoint_detections: list[dict]) -> list[torch.Tensor]:
        """Convert keypoint predictions to 1D feature vectors.

        Post-processing consists of flattening the keypoint coordinates and
        normalizing them relative to the bounding box coordinates.

        Args:
            keypoint_detections (list[dict]): Outputs of the keypoint extractor
                containing detected keypoints and bounding boxes.

        Returns:
            list[torch.Tensor]: List of pose feature tensors for each image, where
                each tensor has shape ``(N, K*2)`` with ``N`` being the number of
                detections and ``K`` the number of keypoints.
        """
        poses = []
        for detection in keypoint_detections:
            boxes = detection["boxes"].unsqueeze(1)
            keypoints = detection["keypoints"]
            normalized_keypoints = (keypoints[..., :2] - boxes[..., :2]) / (boxes[..., 2:] - boxes[..., :2])
            length = normalized_keypoints.shape[-1] * normalized_keypoints.shape[-2]
            poses.append(normalized_keypoints.reshape(normalized_keypoints.shape[0], length))
        return poses
Convert keypoint predictions to 1D feature vectors.

        Post-processing consists of flattening the keypoint coordinates and
        normalizing them relative to the bounding box coordinates.

        Args:
            keypoint_detections (list[dict]): Outputs of the keypoint extractor
                containing detected keypoints and bounding boxes.

        Returns:
            list[torch.Tensor]: List of pose feature tensors for each image, where
                each tensor has shape ``(N, K*2)`` with ``N`` being the number of
                detections and ``K`` the number of keypoints.
        
src/anomalib/models/video/ai_vad/features.py