class_docstr: Stores sorted anomaly scores of a single ground truth component.
  Used to efficiently compute the region overlap for many increasing thresholds.
docstr: Compute the region overlap for a specific threshold.
  Thresholds must be passed in increasing order.
  Args:
      threshold: Threshold to compute the region overlap.
  Returns:
      Region overlap for the specified threshold.
code: def compute_overlap(self, threshold):
      """
      Compute the region overlap for a specific threshold.
      Thresholds must be passed in increasing order.
      Args:
          threshold: Threshold to compute the region overlap.
      Returns:
          Region overlap for the specified threshold.
      """
      if self.last_threshold is not None:
          assert self.last_threshold <= threshold
  
      # Increase the index until it points to an anomaly score that is just above the specified threshold.
      while (
          self.index < len(self.anomaly_scores)
          and self.anomaly_scores[self.index] <= threshold
      ):
          self.index += 1
  
      # Compute the fraction of component pixels that are correctly segmented as anomalous.
      return 1.0 - self.index / len(self.anomaly_scores)
  
file_path: anomalib/tests/helpers/aupro_reference.py
imports: from bisect import bisect
  import numpy
  from scipy.ndimage.measurements import label
label_desc: Use image node_id 2 for calling the GroundTruthComponent obj's underlying member method code with example usage: obj.compute_overlap(threshold) and returns: unknown