code: def __init__(self, gpuid=-1):
      self.minsize = 40  # minimum size of face
      self.threshold = [0.6, 0.7, 0.7]  # three steps's threshold
      self.factor = 0.709  # scale factor
  
      current_dir = os.path.dirname(
          os.path.abspath(inspect.getfile(inspect.currentframe()))
      )
  
      with tf.device(
          "/"
          + ("cpu" if gpuid < 0 else "gpu")
          + ":"
          + ("0" if gpuid < 0 else str(gpuid))
      ):
          with tf.Graph().as_default():
              sess = tf.Session(
                  config=tf.ConfigProto(
                      device_count={"GPU": 0 if gpuid < 0 else 1}
                  )
              )
              with sess.as_default():
                  self.pnet, self.rnet, self.onet = create_detector(
                      sess, "{}/mtcnn".format(current_dir)
                  )
                  print("MTCNN loaded")
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
  import cv2
  import os
  import inspect
label_desc: Use image node_id 1 to create a new Face_Detector object from inherited base classes: object with example: obj = Face_Detector(gpuid)