code: def autodetect(self, img, max_num=0, metric="max"):
      bboxes, kpss = self.detect(img, input_size=(640, 640), thresh=0.5)
      bboxes2, kpss2 = self.detect(
          img, input_size=(128, 128), thresh=0.5
      )
      bboxes_all = np.concatenate([bboxes, bboxes2], axis=0)
      kpss_all = np.concatenate([kpss, kpss2], axis=0)
      keep = self.nms(bboxes_all)
      det = bboxes_all[keep, :]
      kpss = kpss_all[keep, :]
      if max_num > 0 and det.shape[0] > max_num:
          area = (det[:, 2] - det[:, 0]) * (det[:, 3] - det[:, 1])
          img_center = img.shape[0] // 2, img.shape[1] // 2
          offsets = np.vstack(
              [
                  (det[:, 0] + det[:, 2]) / 2 - img_center[1],
                  (det[:, 1] + det[:, 3]) / 2 - img_center[0],
              ]
          )
          offset_dist_squared = np.sum(np.power(offsets, 2.0), 0)
          if metric == "max":
              values = area
          else:
              values = (
                  area - offset_dist_squared * 2.0
              )  # some extra weight on the centering
          bindex = np.argsort(values)[
              ::-1
          ]  # some extra weight on the centering
          bindex = bindex[0:max_num]
          det = det[bindex, :]
          if kpss is not None:
              kpss = kpss[bindex, :]
      return det, kpss
  
file_path: insightface/web-demos/src_recognition/scrfd.py
imports: from __future__ import division
  import datetime
  import numpy
  import onnxruntime
  import os
  import os.path
  import cv2
  import sys
label_desc: Use image node_id 6 for calling the SCRFD obj's underlying member method code with example usage: obj.autodetect(img, max_num, metric) and returns: det,  kpss