caffe_model.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:face 作者: xpzouying 项目源码 文件源码
def init_caffe_model(model_path):
    """Init caffe model for detect face.

    """

    print('Creating networks and loading parameters')
    print('Load models path: ', model_path)

    start = time.time()  # measure load caffe model

    with tf.Graph().as_default():
        # TODO: GUI accelerate
        gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=1.0)
        sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options, log_device_placement=False))
        with sess.as_default():
            pnet, rnet, onet = detect_face.create_mtcnn(sess, model_path)
            global _pnet
            _pnet = pnet
            global _rnet
            _rnet = rnet
            global _onet
            _onet = onet

    print('time used: ', time.time()-start)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号