class_docstr: The MMOCR Text Detection Local Visualizer.
  
  Args:
      name (str): Name of the instance. Defaults to 'visualizer'.
      image (np.ndarray, optional): The origin image to draw. The format
          should be RGB. Defaults to None.
      with_poly (bool): Whether to draw polygons. Defaults to True.
      with_bbox (bool): Whether to draw bboxes. Defaults to False.
      vis_backends (list, optional): Visual backend config list.
          Defaults to None.
      save_dir (str, optional): Save file dir for all storage backends.
          If it is None, the backend storage will not save any data.
      gt_color (Union[str, tuple, list[str], list[tuple]]): The
          colors of GT polygons and bboxes. ``colors`` can have the same
          length with lines or just single value. If ``colors`` is single
          value, all the lines will have the same colors. Refer to
          `matplotlib.colors` for full list of formats that are accepted.
          Defaults to 'g'.
      gt_ignored_color (Union[str, tuple, list[str], list[tuple]]): The
          colors of ignored GT polygons and bboxes. ``colors`` can have
          the same length with lines or just single value. If ``colors``
          is single value, all the lines will have the same colors. Refer
          to `matplotlib.colors` for full list of formats that are accepted.
          Defaults to 'b'.
      pred_color (Union[str, tuple, list[str], list[tuple]]): The
          colors of pred polygons and bboxes. ``colors`` can have the same
          length with lines or just single value. If ``colors`` is single
          value, all the lines will have the same colors. Refer to
          `matplotlib.colors` for full list of formats that are accepted.
          Defaults to 'r'.
      line_width (int, float): The linewidth of lines. Defaults to 2.
      alpha (float): The transparency of bboxes or polygons. Defaults to 0.8.
code: def __init__(
      self,
      name: str = "visualizer",
      image: Optional[np.ndarray] = None,
      with_poly: bool = True,
      with_bbox: bool = False,
      vis_backends: Optional[Dict] = None,
      save_dir: Optional[str] = None,
      gt_color: Union[str, Tuple, List[str], List[Tuple]] = "g",
      gt_ignored_color: Union[str, Tuple, List[str], List[Tuple]] = "b",
      pred_color: Union[str, Tuple, List[str], List[Tuple]] = "r",
      line_width: Union[int, float] = 2,
      alpha: float = 0.8,
  ) -> None:
      super().__init__(
          name=name,
          image=image,
          vis_backends=vis_backends,
          save_dir=save_dir,
      )
      self.with_poly = with_poly
      self.with_bbox = with_bbox
      self.gt_color = gt_color
      self.gt_ignored_color = gt_ignored_color
      self.pred_color = pred_color
      self.line_width = line_width
      self.alpha = alpha
  
file_path: mmocr/mmocr/visualization/textdet_visualizer.py
imports: from typing import Dict, List, Optional, Sequence, Tuple, Union
  import mmcv
  import numpy
  import torch
  from mmocr.registry import VISUALIZERS
  from mmocr.structures import TextDetDataSample
  from .base_visualizer import BaseLocalVisualizer
label_desc: Use image node_id 1 to create a new TextDetLocalVisualizer object from inherited base classes: BaseLocalVisualizer with example: obj = TextDetLocalVisualizer(name, image, with_poly, with_bbox, vis_backends, save_dir, gt_color, gt_ignored_color, pred_color, line_width, alpha)