def _keep_only_persons(self, regions: dict[str, torch.Tensor]) -> dict[str, torch.Tensor]:
        """Remove all region detections that are not labeled as a person.

        Args:
            regions (dict[str, torch.Tensor]): Region detections for a single image in
                the batch.

        Returns:
            dict[str, torch.Tensor]: Region detections from which non-person objects
                have been removed.
        """
        keep = torch.where(regions["labels"] == PERSON_LABEL)
        return self.subsample_regions(regions, keep)
Remove all region detections that are not labeled as a person.

        Args:
            regions (dict[str, torch.Tensor]): Region detections for a single image in
                the batch.

        Returns:
            dict[str, torch.Tensor]: Region detections from which non-person objects
                have been removed.
        
src/anomalib/models/video/ai_vad/regions.py