class_docstr: Area under per region overlap (AUPRO) Metric.
class_docstr_tok: ["Area","under","per","region","overlap","(","AUPRO",")","Metric","."]
docstr: Perform the Connected Component Analysis on the self.target tensor.
  
  Raises:
      ValueError: ValueError is raised if self.target doesn't conform with requirements imposed by kornia for
                  connected component analysis.
  
  Returns:
      Tensor: Components labeled from 0 to N.
docstr_tok: ["Perform","the","Connected","Component","Analysis","on","the","self.target","tensor",".","Raises",":","ValueError",":","ValueError","is","raised","if","self.target","does","n't","conform","with","requirements","imposed","by","kornia","for","connected","component","analysis",".","Returns",":","Tensor",":","Components","labeled","from","0","to","N","."]
code: def perform_cca(self) -> Tensor:
      """Perform the Connected Component Analysis on the self.target tensor.
  
      Raises:
          ValueError: ValueError is raised if self.target doesn't conform with requirements imposed by kornia for
                      connected component analysis.
  
      Returns:
          Tensor: Components labeled from 0 to N.
      """
      target = dim_zero_cat(self.target)
  
      # check and prepare target for labeling via kornia
      if target.min() < 0 or target.max() > 1:
          raise ValueError(
              f"kornia.contrib.connected_components expects input to lie in the interval [0, 1], but found "
              f"interval was [{target.min()}, {target.max()}]."
          )
      target = target.unsqueeze(1)  # kornia expects N1HW format
      target = target.type(torch.float)  # kornia expects FloatTensor
      if target.is_cuda:
          cca = connected_components_gpu(target)
      else:
          cca = connected_components_cpu(target)
  
      return cca
  
imports: from __future__ import annotations
  from typing import Any, Callable
  import torch
  from matplotlib.figure import Figure
  from torch import Tensor
  from torchmetrics import Metric
  from torchmetrics.functional import auc
  from torchmetrics.functional.classification import binary_roc
  from torchmetrics.utilities.data import dim_zero_cat
  from anomalib.utils.metrics.pro import connected_components_cpu, connected_components_gpu
  from .binning import thresholds_between_0_and_1, thresholds_between_min_and_max
  from .plotting_utils import plot_figure
label_desc: Use image node_id 3 for calling the AUPRO obj's underlying member method code with example usage: obj.perform_cca() and returns: cca