Пример #1
0
    def __init__(self):
        self.x = tf.placeholder(tf.float32, [1, 227, 227, 3])
        self.age = tf.nn.softmax(Model.AGE_NET(self.x, 1.0))

        self.sess = tf.Session()
        self.saver = tf.train.Saver()
        super(AGE_NET, self).__init__()
Пример #2
0
    def __init__(self):
        gpuConfig = tf.ConfigProto(
            gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction = 0.5))
        self.x224 = tf.placeholder(tf.float32, [1, 224, 224, 3])
        self.x227 = tf.placeholder(tf.float32, [1, 227, 227, 3])
        self.pred, self.features = Model.VGG_NET(self.x224, 1.0, n_classes)
        self.person = tf.nn.softmax(self.pred)
        self.age = tf.nn.softmax(Model.AGE_NET(self.x227, 1.0))
        self.gender = tf.nn.softmax(Model.GENDER_NET(self.x227, 1.0))

        self.sess = tf.Session(config = gpuConfig)
        self.saver = tf.train.Saver()
        self.init = tf.initialize_all_variables()

        super(FACE_NET, self).__init__()