class_docstr: Callback that standardizes the image-level and pixel-level anomaly scores.
class_docstr_tok: ["Callback","that","standardizes","the","image-level","and","pixel-level","anomaly","scores","."]
docstr: Called when the predict batch ends, normalizes the predicted scores and anomaly maps.
docstr_tok: ["Called","when","the","predict","batch","ends",",","normalizes","the","predicted","scores","and","anomaly","maps","."]
code: def on_predict_batch_end(
      self,
      trainer: pl.Trainer,
      pl_module: AnomalyModule,
      outputs: dict,
      batch: Any,
      batch_idx: int,
      dataloader_idx: int,
  ) -> None:
      """Called when the predict batch ends, normalizes the predicted scores and anomaly maps."""
      del (
          trainer,
          batch,
          batch_idx,
          dataloader_idx,
      )  # These variables are not used.
  
      self._standardize_batch(outputs, pl_module)
      self._normalize_batch(outputs, pl_module)
      outputs["pred_labels"] = outputs["pred_scores"] >= 0.5
  
imports: from __future__ import annotations
  import logging
  from typing import Any
  import pytorch_lightning
  from pytorch_lightning import Callback, Trainer
  from pytorch_lightning.utilities.types import STEP_OUTPUT
  from torch.distributions import LogNormal
  from anomalib.models import get_model
  from anomalib.models.components import AnomalyModule
  from anomalib.post_processing.normalization.cdf import normalize, standardize
  from anomalib.utils.metrics import AnomalyScoreDistribution
label_desc: Use image node_id 7 for calling the CdfNormalizationCallback obj's underlying member method code with example usage: obj.on_predict_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx) without return types