def __init__(self, num_thresholds: int) -> None:
        """Initialize PIMO metric.

        Args:
            num_thresholds: Number of thresholds for curve computation (K).
                Must be >= 2.
        """
        super().__init__()

        logger.warning(
            f"Metric `{self.__class__.__name__}` will save all targets and "
            "predictions in buffer. For large datasets this may lead to large "
            "memory footprint.",
        )

        # Validate options early to avoid later errors
        _validate.is_num_thresholds_gte2(num_thresholds)
        self.num_thresholds = num_thresholds

        self.add_state("anomaly_maps", default=[], dist_reduce_fx="cat")
        self.add_state("masks", default=[], dist_reduce_fx="cat")
Initialize PIMO metric.

        Args:
            num_thresholds: Number of thresholds for curve computation (K).
                Must be >= 2.
        
src/anomalib/metrics/pimo/pimo.py