code: def test_call(self):
      # single img
      img_path = "tests/data/det_toy_dataset/imgs/test/img_1.jpg"
      res_path = self.inferencer(img_path, return_vis=True)
      # ndarray
      img = mmcv.imread(img_path)
      res_ndarray = self.inferencer(img, return_vis=True)
      self.assert_predictions_equal(
          res_path["predictions"], res_ndarray["predictions"]
      )
      self.assertTrue(
          np.allclose(
              res_path["visualization"], res_ndarray["visualization"]
          )
      )
  
      # multiple images
      img_paths = [
          "tests/data/det_toy_dataset/imgs/test/img_1.jpg",
          "tests/data/det_toy_dataset/imgs/test/img_2.jpg",
      ]
      res_path = self.inferencer(img_paths, return_vis=True)
      # list of ndarray
      imgs = [mmcv.imread(p) for p in img_paths]
      res_ndarray = self.inferencer(imgs, return_vis=True)
      self.assert_predictions_equal(
          res_path["predictions"], res_ndarray["predictions"]
      )
      for i in range(len(img_paths)):
          self.assertTrue(
              np.allclose(
                  res_path["visualization"][i],
                  res_ndarray["visualization"][i],
              )
          )
  
      # img dir, test different batch sizes
      img_dir = "tests/data/det_toy_dataset/imgs/test/"
      res_bs1 = self.inferencer(img_dir, batch_size=1, return_vis=True)
      res_bs3 = self.inferencer(img_dir, batch_size=3, return_vis=True)
      self.assert_predictions_equal(
          res_bs1["predictions"], res_bs3["predictions"]
      )
      self.assertTrue(
          np.array_equal(
              res_bs1["visualization"], res_bs3["visualization"]
          )
      )
  
imports: import os.path
  import random
  import tempfile
  from unittest import TestCase, mock
  import mmcv
  import mmengine
  import numpy
  import torch
  from mmengine.structures import InstanceData
  from mmocr.apis.inferencers import TextDetInferencer
  from mmocr.utils.check_argument import is_type_list
  from mmocr.utils.typing_utils import TextDetDataSample
label_desc: Use image node_id 5 for calling the TestTextDetinferencer obj's underlying member method code with example usage: obj.test_call() without return types