class_docstr: Per-Region Overlap (PRO) Score.
class_docstr_tok: ["Per-Region","Overlap","(","PRO",")","Score","."]
code: def __init__(self, threshold: float = 0.5, **kwargs) -> None:
      super().__init__(**kwargs)
      self.threshold = threshold
  
      self.add_state("preds", default=[], dist_reduce_fx="cat")
      self.add_state("target", default=[], dist_reduce_fx="cat")
  
file_path: anomalib/src/anomalib/utils/metrics/pro.py
imports: from __future__ import annotations
  import torch
  from torch import Tensor
  from torchmetrics import Metric
  from torchmetrics.functional import recall
  from torchmetrics.utilities.data import dim_zero_cat
  from anomalib.utils.cv import connected_components_cpu, connected_components_gpu
label_desc: Use image node_id 1 to create a new PRO object from inherited base classes: Metric with example: obj = PRO(threshold)