class_docstr: AnomalyModule to train, validate, predict and test images.
  
  Acts as a base class for all the Anomaly Modules in the library.
class_docstr_tok: ["AnomalyModule","to","train",",","validate",",","predict","and","test","images",".","Acts","as","a","base","class","for","all","the","Anomaly","Modules","in","the","library","."]
code: def _compute_adaptive_threshold(self, outputs: EPOCH_OUTPUT) -> None:
      self.image_threshold.reset()
      self.pixel_threshold.reset()
      self._collect_outputs(
          self.image_threshold, self.pixel_threshold, outputs
      )
      self.image_threshold.compute()
      if (
          "mask" in outputs[0].keys()
          and "anomaly_maps" in outputs[0].keys()
      ):
          self.pixel_threshold.compute()
      else:
          self.pixel_threshold.value = self.image_threshold.value
  
      self.image_metrics.set_threshold(
          self.image_threshold.value.item()
      )
      self.pixel_metrics.set_threshold(
          self.pixel_threshold.value.item()
      )
  
imports: from __future__ import annotations
  import importlib
  import logging
  from abc import ABC
  from typing import Any, OrderedDict
  from warnings import warn
  import pytorch_lightning
  import torch
  from pytorch_lightning.callbacks import Callback
  from pytorch_lightning.utilities.types import EPOCH_OUTPUT, STEP_OUTPUT
  from torch import Tensor, nn
  from torchmetrics import Metric
  from anomalib.data.utils import boxes_to_anomaly_maps, boxes_to_masks, masks_to_boxes
  from anomalib.post_processing import ThresholdMethod
  from anomalib.utils.metrics import AnomalibMetricCollection, AnomalyScoreDistribution, AnomalyScoreThreshold, MinMax
label_desc: Use image node_id 10 for calling the AnomalyModule obj's underlying member method code with example usage: obj._compute_adaptive_threshold(outputs) without return types