(self, model_path)
Parameters
    ----------
    model_path : str
      Path to the trained model.
Parameters
    ----------
    model_path : str
      Path to the trained model.
Parameters ---------- model_path : str Path to the trained model .
def __init__(self, model_path):
    """
    Parameters
    ----------
    model_path : str
      Path to the trained model.
    """
    self.graph = tf.Graph()
    with self.graph.as_default():
      with tf.variable_scope('prior_based_hand'):
        config = tf.ConfigProto()
        config.gpu_options.allow_growth = True
        self.sess = tf.Session(config=config)
        self.input_ph = tf.placeholder(tf.uint8, [128, 128, 3])
        self.feed_img = \
          tf.cast(tf.expand_dims(self.input_ph, 0), tf.float32) / 255
        self.hmaps, self.dmaps, self.lmaps = \
          detnet(self.feed_img, 1, False)

        self.hmap = self.hmaps[-1]
        self.dmap = self.dmaps[-1]
        self.lmap = self.lmaps[-1]

        self.uv = tf_hmap_to_uv(self.hmap)
        self.delta = tf.gather_nd(
          tf.transpose(self.dmap, [0, 3, 1, 2, 4]), self.uv, batch_dims=2
        )[0]
        self.xyz = tf.gather_nd(
          tf.transpose(self.lmap, [0, 3, 1, 2, 4]), self.uv, batch_dims=2
        )[0]

        self.uv = self.uv[0]
      tf.train.Saver().restore(self.sess, model_path)
def __init__ ( self , model_path ) : self . graph = tf . Graph ( ) with self . graph . as_default ( ) : with tf . variable_scope ( 'prior_based_hand' ) : config = tf . ConfigProto ( ) config . gpu_options . allow_growth = True self . sess = tf . Session ( config = config ) self . input_ph = tf . placeholder ( tf . uint8 , [ 128 , 128 , 3 ] ) self . feed_img = tf . cast ( tf . expand_dims ( self . input_ph , 0 ) , tf . float32 ) / 255 self . hmaps , self . dmaps , self . lmaps = detnet ( self . feed_img , 1 , False ) self . hmap = self . hmaps [ - 1 ] self . dmap = self . dmaps [ - 1 ] self . lmap = self . lmaps [ - 1 ] self . uv = tf_hmap_to_uv ( self . hmap ) self . delta = tf . gather_nd ( tf . transpose ( self . dmap , [ 0 , 3 , 1 , 2 , 4 ] ) , self . uv , batch_dims = 2 ) [ 0 ] self . xyz = tf . gather_nd ( tf . transpose ( self . lmap , [ 0 , 3 , 1 , 2 , 4 ] ) , self . uv , batch_dims = 2 ) [ 0 ] self . uv = self . uv [ 0 ] tf . train . Saver ( ) . restore ( self . sess , model_path )