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.
docstr: Run after every testing iterations.
  
  Args:
      runner (:obj:`Runner`): The runner of the testing process.
      batch_idx (int): The index of the current batch in the val loop.
      data_batch (Sequence[dict]): Data from dataloader.
      outputs (Sequence[:obj:`TextDetDataSample` or
          :obj:`TextRecogDataSample`]): Outputs from model.
docstr_tok: ["Run","after","every","testing","iterations",".","Args",":","runner","(",":","obj",":","`","Runner","`",")",":","The","runner","of","the","testing","process",".","batch_idx","(","int",")",":","The","index","of","the","current","batch","in","the","val","loop",".","data_batch","(","Sequence","[","dict","]",")",":","Data","from","dataloader",".","outputs","(","Sequence","[",":","obj",":","`","TextDetDataSample","`","or",":","obj",":","`","TextRecogDataSample","`","]",")",":","Outputs","from","model","."]
code: def after_test_iter(
      self,
      runner: Runner,
      batch_idx: int,
      data_batch: Sequence[dict],
      outputs: Sequence[Union[TextDetDataSample, TextRecogDataSample]],
  ) -> None:
      """Run after every testing iterations.
  
      Args:
          runner (:obj:`Runner`): The runner of the testing process.
          batch_idx (int): The index of the current batch in the val loop.
          data_batch (Sequence[dict]): Data from dataloader.
          outputs (Sequence[:obj:`TextDetDataSample` or
              :obj:`TextRecogDataSample`]): Outputs from model.
      """
  
      if self.enable is False:
          return
  
      for output in outputs:
          img_path = output.img_path
          img_bytes = fileio.get(
              img_path, backend_args=self.backend_args
          )
          img = mmcv.imfrombytes(img_bytes, channel_order="rgb")
  
          self._visualizer.add_datasample(
              osp.splitext(osp.basename(img_path))[0],
              img,
              data_sample=output,
              show=self.show,
              draw_gt=self.draw_gt,
              draw_pred=self.draw_pred,
              wait_time=self.wait_time,
              pred_score_thr=self.score_thr,
              step=batch_idx,
          )
  
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 3 for calling the VisualizationHook obj's underlying member method code with example usage: obj.after_test_iter(runner, batch_idx, data_batch, outputs) without return types