class_docstr: Class that handles the logic of composing the visualizations.
  
  Args:
      mode (VisualizationMode): visualization mode, either "full" or "simple"
      task (TaskType): task type "segmentation", "detection" or "classification"
code: def __init__(self, mode: VisualizationMode, task: TaskType) -> None:
      if mode not in (VisualizationMode.FULL, VisualizationMode.SIMPLE):
          raise ValueError(
              f"Unknown visualization mode: {mode}. Please choose one of ['full', 'simple']"
          )
      self.mode = mode
      if task not in (
          TaskType.CLASSIFICATION,
          TaskType.DETECTION,
          TaskType.SEGMENTATION,
      ):
          raise ValueError(
              f"Unknown task type: {mode}. Please choose one of ['classification', 'detection', 'segmentation']"
          )
      self.task = task
  
imports: from __future__ import annotations
  from dataclasses import dataclass, field
  from enum import Enum
  from pathlib import Path
  from typing import Iterator
  import cv2
  import matplotlib.figure
  import matplotlib.pyplot
  import numpy
  from skimage.segmentation import mark_boundaries
  from anomalib.data import TaskType
  from anomalib.data.utils import read_image
  from anomalib.post_processing.post_process import add_anomalous_label, add_normal_label, draw_boxes, superimpose_anomaly_map
label_desc: Use image node_id 1 to create a new Visualizer object  with example: obj = Visualizer(mode, task)