def get_net(caffemodel, deploy_file, use_gpu=True):
"""
Returns an instance of caffe.Net
Arguments:
caffemodel -- path to a .caffemodel file
deploy_file -- path to a .prototxt file
Keyword arguments:
use_gpu -- if True, use the GPU for inference
"""
#if use_gpu:
# caffe.set_mode_gpu()
caffe.set_mode_cpu()
# load a new model
return caffe.Net(deploy_file, caffemodel, caffe.TEST)
# Transformer function to perform image transformation
评论列表
文章目录