class_docstr: Detection Visualization Hook. Used to visualize validation and testing
  process prediction results.
  
  Args:
      enable (bool): Whether to enable this hook. Defaults to False.
      interval (int): The interval of visualization. Defaults to 50.
      score_thr (float): The threshold to visualize the bboxes
          and masks. It's only useful for text detection. Defaults to 0.3.
      show (bool): Whether to display the drawn image. Defaults to False.
      wait_time (float): The interval of show in seconds. Defaults
          to 0.
      backend_args (dict, optional): Instantiates the corresponding file
          backend. It may contain `backend` key to specify the file
          backend. If it contains, the file backend corresponding to this
          value will be used and initialized with the remaining values,
          otherwise the corresponding file backend will be selected
          based on the prefix of the file path. Defaults to None.
code: def __init__(
      self,
      enable: bool = False,
      interval: int = 50,
      score_thr: float = 0.3,
      show: bool = False,
      draw_pred: bool = False,
      draw_gt: bool = False,
      wait_time: float = 0.0,
      backend_args: Optional[dict] = None,
  ) -> None:
      self._visualizer: Visualizer = Visualizer.get_current_instance()
      self.interval = interval
      self.score_thr = score_thr
      self.show = show
      self.draw_pred = draw_pred
      self.draw_gt = draw_gt
      self.wait_time = wait_time
      self.backend_args = backend_args
      self.enable = enable
  
file_path: mmocr/mmocr/engine/hooks/visualization_hook.py
imports: import os.path
  from typing import Optional, Sequence, Union
  import mmcv
  import mmengine.fileio
  from mmengine.hooks import Hook
  from mmengine.runner import Runner
  from mmengine.visualization import Visualizer
  from mmocr.registry import HOOKS
  from mmocr.structures import TextDetDataSample, TextRecogDataSample
label_desc: Use image node_id 1 to create a new VisualizationHook object from inherited base classes: Hook with example: obj = VisualizationHook(enable, interval, score_thr, show, draw_pred, draw_gt, wait_time, backend_args)