code: def get(self, img, face):
      bbox = face.bbox
      w, h = (bbox[2] - bbox[0]), (bbox[3] - bbox[1])
      center = (bbox[2] + bbox[0]) / 2, (bbox[3] + bbox[1]) / 2
      rotate = 0
      _scale = self.input_size[0] / (max(w, h) * 1.5)
      # print('param:', img.shape, bbox, center, self.input_size, _scale, rotate)
      aimg, M = face_align.transform(
          img, center, self.input_size[0], _scale, rotate
      )
      input_size = tuple(aimg.shape[0:2][::-1])
      # assert input_size==self.input_size
      blob = cv2.dnn.blobFromImage(
          aimg,
          1.0 / self.input_std,
          input_size,
          (self.input_mean, self.input_mean, self.input_mean),
          swapRB=True,
      )
      pred = self.session.run(
          self.output_names, {self.input_name: blob}
      )[0][0]
      if self.taskname == "genderage":
          assert len(pred) == 3
          gender = np.argmax(pred[:2])
          age = int(np.round(pred[2] * 100))
          face["gender"] = gender
          face["age"] = age
          return gender, age
      else:
          return pred
  
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 3 for calling the Attribute obj's underlying member method code with example usage: obj.get(img, face) and returns: gender,  age, pred