code: def get_model(name, **kwargs):
      root = kwargs.get("root", "~/.insightface")
      root = os.path.expanduser(root)
      model_root = osp.join(root, "models")
      allow_download = kwargs.get("download", False)
      download_zip = kwargs.get("download_zip", False)
      if not name.endswith(".onnx"):
          model_dir = os.path.join(model_root, name)
          model_file = find_onnx_file(model_dir)
          if model_file is None:
              return None
      else:
          model_file = name
      if not osp.exists(model_file) and allow_download:
          model_file = download_onnx(
              "models", model_file, root=root, download_zip=download_zip
          )
      assert osp.exists(model_file), (
          "model_file %s should exist" % model_file
      )
      assert osp.isfile(model_file), (
          "model_file %s should be a file" % model_file
      )
      router = ModelRouter(model_file)
      providers = kwargs.get("providers", get_default_providers())
      provider_options = kwargs.get(
          "provider_options", get_default_provider_options()
      )
      model = router.get_model(
          providers=providers, provider_options=provider_options
      )
      return model
  
imports: import os
  import os.path
  import glob
  import onnxruntime
  from .arcface_onnx import *
  from .retinaface import *
  from .landmark import *
  from .attribute import Attribute
  from .inswapper import INSwapper
  from ..utils import download_onnx
label_desc: Use image node_id 4 for calling a global function with example usage: get_model(name) and returns: model, None