code: def create_detector(sess, model_path):
      with tf.variable_scope("pnet"):
          data = tf.placeholder(
              tf.float32, (None, None, None, 3), "input"
          )
          pnet = PNet({"data": data})
          pnet.load(os.path.join(model_path, "cas1.npy"), sess)
      with tf.variable_scope("rnet"):
          data = tf.placeholder(tf.float32, (None, 24, 24, 3), "input")
          rnet = RNet({"data": data})
          rnet.load(os.path.join(model_path, "cas2.npy"), sess)
      with tf.variable_scope("onet"):
          data = tf.placeholder(tf.float32, (None, 48, 48, 3), "input")
          onet = ONet({"data": data})
          onet.load(os.path.join(model_path, "cas3.npy"), sess)
  
      pnet_fun = lambda img: sess.run(
          ("pnet/conv4-2/BiasAdd:0", "pnet/prob1:0"),
          feed_dict={"pnet/input:0": img},
      )
      rnet_fun = lambda img: sess.run(
          ("rnet/conv5-2/conv5-2:0", "rnet/prob1:0"),
          feed_dict={"rnet/input:0": img},
      )
      onet_fun = lambda img: sess.run(
          (
              "onet/conv6-2/conv6-2:0",
              "onet/conv6-3/conv6-3:0",
              "onet/prob1:0",
          ),
          feed_dict={"onet/input:0": img},
      )
      return pnet_fun, rnet_fun, onet_fun
  
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 2 for calling a global function with example usage: create_detector(sess, model_path) and returns: pnet_fun,  rnet_fun,  onet_fun