code: def get_recognizer(
      recog_network,
      network_params,
      character,
      separator_list,
      dict_list,
      model_path,
      device="cpu",
      quantize=True,
  ):
      converter = CTCLabelConverter(
          character, separator_list, dict_list
      )
      num_class = len(converter.character)
  
      if recog_network == "generation1":
          model_pkg = importlib.import_module("easyocr.model.model")
      elif recog_network == "generation2":
          model_pkg = importlib.import_module("easyocr.model.vgg_model")
      else:
          model_pkg = importlib.import_module(recog_network)
      model = model_pkg.Model(num_class=num_class, **network_params)
  
      if device == "cpu":
          state_dict = torch.load(model_path, map_location=device)
          new_state_dict = OrderedDict()
          for key, value in state_dict.items():
              new_key = key[7:]
              new_state_dict[new_key] = value
          model.load_state_dict(new_state_dict)
          if quantize:
              try:
                  torch.quantization.quantize_dynamic(
                      model, dtype=torch.qint8, inplace=True
                  )
              except:
                  pass
      else:
          model = torch.nn.DataParallel(model).to(device)
          model.load_state_dict(
              torch.load(model_path, map_location=device)
          )
  
      return model, converter
  
imports: from PIL import Image
  import torch
  import torch.backends.cudnn
  import torch.utils.data
  import torch.nn.functional
  import torchvision.transforms
  import numpy
  from collections import OrderedDict
  import importlib
  from .utils import CTCLabelConverter
  import math
label_desc: Use image node_id 5 for calling a global function with example usage: get_recognizer(recog_network, network_params, character, separator_list, dict_list, model_path, device, quantize) and returns: model,  converter