def forward(self, batch: torch.Tensor, boxes: torch.Tensor) -> list[torch.Tensor]:
        """Extract pose features using a human keypoint estimation model.

        The method performs the following steps:
        1. Transform input images
        2. Extract backbone features
        3. Pool ROI features for each box
        4. Predict keypoint locations
        5. Post-process predictions

        Args:
            batch (torch.Tensor): Batch of RGB input images of shape
                ``(N, 3, H, W)``.
            boxes (torch.Tensor): Bounding box coordinates of shape ``(M, 5)``.
                First column indicates batch index of the bbox, remaining columns
                are coordinates ``[x1, y1, x2, y2]``.

        Returns:
            list[torch.Tensor]: List of pose feature tensors for each image, where
                each tensor contains normalized keypoint coordinates.
        """
        images, _ = self.transform(batch)
        features = self.backbone(images.tensors)

        image_sizes = [b.shape[-2:] for b in batch]
        scales = [
            torch.Tensor(new) / torch.Tensor([orig[0], orig[1]])
            for orig, new in zip(image_sizes, images.image_sizes, strict=True)
        ]

        boxes = [box * scale.repeat(2).to(box.device) for box, scale in zip(boxes, scales, strict=True)]

        keypoint_features = self.roi_heads.keypoint_roi_pool(features, boxes, images.image_sizes)
        keypoint_features = self.roi_heads.keypoint_head(keypoint_features)
        keypoint_logits = self.roi_heads.keypoint_predictor(keypoint_features)
        keypoints_probs, _ = keypointrcnn_inference(keypoint_logits, boxes)

        keypoint_detections = self.transform.postprocess(
            [{"keypoints": keypoints, "boxes": box} for keypoints, box in zip(keypoints_probs, boxes, strict=True)],
            images.image_sizes,
            image_sizes,
        )
        return self._post_process(keypoint_detections)
Extract pose features using a human keypoint estimation model.

        The method performs the following steps:
        1. Transform input images
        2. Extract backbone features
        3. Pool ROI features for each box
        4. Predict keypoint locations
        5. Post-process predictions

        Args:
            batch (torch.Tensor): Batch of RGB input images of shape
                ``(N, 3, H, W)``.
            boxes (torch.Tensor): Bounding box coordinates of shape ``(M, 5)``.
                First column indicates batch index of the bbox, remaining columns
                are coordinates ``[x1, y1, x2, y2]``.

        Returns:
            list[torch.Tensor]: List of pose feature tensors for each image, where
                each tensor contains normalized keypoint coordinates.
        
src/anomalib/models/video/ai_vad/features.py