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.
      vis_backends (list, optional): Visual backend config list.
          Default 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.
      fig_save_cfg (dict): Keyword parameters of figure for saving.
          Defaults to empty dict.
      fig_show_cfg (dict): Keyword parameters of figure for showing.
          Defaults to empty dict.
      is_openset (bool, optional): Whether the visualizer is used in
          OpenSet. Defaults to False.
      font_families (Union[str, List[str]]): The font families of labels.
          Defaults to 'sans-serif'.
      font_properties (Union[str, FontProperties], optional):
          The font properties of texts. The format should be a path str
          to font file or a `font_manager.FontProperties()` object.
          If you want to draw Chinese texts, you need to prepare
          a font file that can show Chinese characters properly.
          For example: `simhei.ttf`,`simsun.ttc`,`simkai.ttf` and so on.
          Then set font_properties=matplotlib.font_manager.FontProperties
          (fname='path/to/font_file') or font_properties='path/to/font_file'
          This function need mmengine version >=0.6.0.
          Defaults to None.
code: def _set_font_properties(
      self, fp: Optional[Union[str, FontProperties]] = None
  ):
      if fp is None:
          return None
      elif isinstance(fp, str):
          return FontProperties(fname=fp)
      elif isinstance(fp, FontProperties):
          return fp
      else:
          raise ValueError(
              "font_properties argument type should be"
              " `str` or `matplotlib.font_manager.FontProperties`"
          )
  
file_path: mmocr/mmocr/visualization/base_visualizer.py
imports: import math
  from typing import List, Optional, Sequence, Union
  import numpy
  import torch
  from matplotlib.font_manager import FontProperties
  from mmengine.visualization import Visualizer
  from mmocr.registry import VISUALIZERS
label_desc: Use image node_id 2 for calling the BaseLocalVisualizer obj's underlying member method code with example usage: obj._set_font_properties(fp) and returns: None, FontProperties, fp