code: def __init__(self, model_file=None, session=None):
      assert model_file is not None
      self.model_file = model_file
      self.session = session
      find_sub = False
      find_mul = False
      model = onnx.load(self.model_file)
      graph = model.graph
      for nid, node in enumerate(graph.node[:8]):
          # print(nid, node.name)
          if node.name.startswith("Sub") or node.name.startswith(
              "_minus"
          ):
              find_sub = True
          if node.name.startswith("Mul") or node.name.startswith(
              "_mul"
          ):
              find_mul = True
          if nid < 3 and node.name == "bn_data":
              find_sub = True
              find_mul = True
      if find_sub and find_mul:
          # mxnet arcface model
          input_mean = 0.0
          input_std = 1.0
      else:
          input_mean = 127.5
          input_std = 128.0
      self.input_mean = input_mean
      self.input_std = input_std
      # print('input mean and std:', model_file, self.input_mean, self.input_std)
      if self.session is None:
          self.session = onnxruntime.InferenceSession(
              self.model_file, None
          )
      input_cfg = self.session.get_inputs()[0]
      input_shape = input_cfg.shape
      input_name = input_cfg.name
      self.input_size = tuple(input_shape[2:4][::-1])
      self.input_shape = input_shape
      outputs = self.session.get_outputs()
      output_names = []
      for out in outputs:
          output_names.append(out.name)
      self.input_name = input_name
      self.output_names = output_names
      assert len(self.output_names) == 1
      output_shape = outputs[0].shape
      # print('init output_shape:', output_shape)
      if output_shape[1] == 3:
          self.taskname = "genderage"
      else:
          self.taskname = "attribute_%d" % output_shape[1]
  
file_path: insightface/python-package/insightface/model_zoo/attribute.py
imports: from __future__ import division
  import numpy
  import cv2
  import onnx
  import onnxruntime
  from ..utils import face_align
label_desc: Use image node_id 1 to create a new Attribute object  with example: obj = Attribute(model_file, session)