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".
docstr: Process the inputs into a model-feedable format.
  
  Args:
      inputs (InputsType): Inputs given by user.
      batch_size (int): batch size. Defaults to 1.
  
  Yields:
      Any: Data processed by the ``pipeline`` and ``collate_fn``.
docstr_tok: ["Process","the","inputs","into","a","model-feedable","format",".","Args",":","inputs","(","InputsType",")",":","Inputs","given","by","user",".","batch_size","(","int",")",":","batch","size",".","Defaults","to","1",".","Yields",":","Any",":","Data","processed","by","the","``","pipeline","``","and","``","collate_fn","``","."]
code: def preprocess(
      self, inputs: InputsType, batch_size: int = 1, **kwargs
  ):
      """Process the inputs into a model-feedable format.
  
      Args:
          inputs (InputsType): Inputs given by user.
          batch_size (int): batch size. Defaults to 1.
  
      Yields:
          Any: Data processed by the ``pipeline`` and ``collate_fn``.
      """
      chunked_data = self._get_chunk_data(inputs, batch_size)
      yield from map(self.collate_fn, chunked_data)
  
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 2 for calling the BaseMMOCRInferencer obj's underlying member method code with example usage: obj.preprocess(inputs, batch_size) without return types