code: def load_model(config, **kwargs):
      model_class = get_class_from_str(config["class"])
      model_default_params = get_default_params(model_class)
  
      model_args = dict()
      for pname, param in config["params"].items():
          value = param["value"]
          if param["type"] == "class":
              value = get_class_from_str(value)
  
          if (
              pname not in model_default_params
              and not param["specified"]
          ):
              continue
  
          assert pname in model_default_params
          if (
              not param["specified"]
              and model_default_params[pname].default == value
          ):
              continue
          model_args[pname] = value
  
      model_args.update(kwargs)
  
      return model_class(**model_args)
  
file_path: PaddleSeg/EISeg/eiseg/util/serialization.py
imports: from functools import wraps
  from copy import deepcopy
  import inspect
  import paddle.nn
label_desc: Use image node_id 2 for calling a global function with example usage: load_model(config) and returns: model_class