def __load_caffe_model(self, blob_path, prototxt_path):
"""
Load caffe model to memory
Args:
blob_path: Model in HDF5 format
prototxt_path: Prototxt file. Contains Network implementation
Returns:
"""
net = caffe.Net(prototxt_path, blob_path, caffe.TEST)
input_layer = net.inputs[0]
output_layer = net.outputs[0]
#height = net.blobs["data_q"].data.shape[2]
#width = net.blobs["data_q"].data.shape[3]
height = net.blobs[input_layer].data.shape[2]
width = net.blobs[input_layer].data.shape[3]
self.logger.info("Model has been successfully loaded from Blob:" + blob_path + " , Prototxt:" + prototxt_path)
return net, height, width
评论列表
文章目录