code: def __init__(
      self,
      name=DEFAULT_MP_NAME,
      root="~/.insightface",
      allowed_modules=None,
      **kwargs,
  ):
      onnxruntime.set_default_logger_severity(3)
      self.models = {}
      self.model_dir = ensure_available("models", name, root=root)
      onnx_files = glob.glob(osp.join(self.model_dir, "*.onnx"))
      onnx_files = sorted(onnx_files)
      for onnx_file in onnx_files:
          model = model_zoo.get_model(onnx_file, **kwargs)
          if model is None:
              print("model not recognized:", onnx_file)
          elif (
              allowed_modules is not None
              and model.taskname not in allowed_modules
          ):
              print("model ignore:", onnx_file, model.taskname)
              del model
          elif model.taskname not in self.models and (
              allowed_modules is None
              or model.taskname in allowed_modules
          ):
              print(
                  "find model:",
                  onnx_file,
                  model.taskname,
                  model.input_shape,
                  model.input_mean,
                  model.input_std,
              )
              self.models[model.taskname] = model
          else:
              print(
                  "duplicated model task type, ignore:",
                  onnx_file,
                  model.taskname,
              )
              del model
      assert "detection" in self.models
      self.det_model = self.models["detection"]
  
file_path: insightface/python-package/insightface/app/face_analysis.py
imports: from __future__ import division
  import glob
  import os.path
  import numpy
  import onnxruntime
  from numpy.linalg import norm
  from ..model_zoo import model_zoo
  from ..utils import DEFAULT_MP_NAME, ensure_available
  from .common import Face
label_desc: Use image node_id 1 to create a new FaceAnalysis object  with example: obj = FaceAnalysis(name, root, allowed_modules)