def _filter_by_area(self, regions: dict[str, torch.Tensor], min_area: int) -> dict[str, torch.Tensor]:
        """Remove all regions with a surface area smaller than the specified value.

        Args:
            regions (dict[str, torch.Tensor]): Region detections for a single image in
                the batch.
            min_area (int): Minimum bounding box area. Regions with a surface area
                lower than this value are excluded.

        Returns:
            dict[str, torch.Tensor]: Region detections from which small regions have
                been removed.
        """
        areas = box_area(regions["boxes"])
        keep = torch.where(areas > min_area)
        return self.subsample_regions(regions, keep)
Remove all regions with a surface area smaller than the specified value.

        Args:
            regions (dict[str, torch.Tensor]): Region detections for a single image in
                the batch.
            min_area (int): Minimum bounding box area. Regions with a surface area
                lower than this value are excluded.

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