class_docstr: Base inferencer.
  
  Args:
      model (str, optional): Path to the config file or the model name
          defined in metafile. For example, it could be
          "dbnet_resnet18_fpnc_1200e_icdar2015" or
          "configs/textdet/dbnet/dbnet_resnet18_fpnc_1200e_icdar2015.py".
          If model is not specified, user must provide the
          `weights` saved by MMEngine which contains the config string.
          Defaults to None.
      weights (str, optional): Path to the checkpoint. If it is not specified
          and model is a model name of metafile, the weights will be loaded
          from metafile. Defaults to None.
      device (str, optional): Device to run inference. If None, the available
          device will be automatically used. Defaults to None.
      scope (str, optional): The scope of the model. Defaults to "mmocr".
code: def __init__(
      self,
      model: Union[ModelType, str, None] = None,
      weights: Optional[str] = None,
      device: Optional[str] = None,
      scope: str = "mmocr",
  ) -> None:
      # A global counter tracking the number of images given in the form
      # of ndarray, for naming the output images
      self.num_unnamed_imgs = 0
      init_default_scope(scope)
      super().__init__(
          model=model, weights=weights, device=device, scope=scope
      )
      self.model = revert_sync_batchnorm(self.model)
  
imports: import os.path
  from typing import Dict, Iterable, List, Optional, Sequence, Tuple, Union
  import mmcv
  import mmengine
  import numpy
  from mmengine.dataset import Compose
  from mmengine.infer.infer import BaseInferencer, ModelType
  from mmengine.model.utils import revert_sync_batchnorm
  from mmengine.registry import init_default_scope
  from mmengine.structures import InstanceData
  from rich.progress import track
  from torch import Tensor
  from mmocr.utils import ConfigType
label_desc: Use image node_id 1 to create a new BaseMMOCRInferencer object from inherited base classes: BaseInferencer with example: obj = BaseMMOCRInferencer(model, weights, device, scope)