caffe_utils.py 文件源码

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

项目:CNN_Visualization 作者: albioTQ 项目源码 文件源码
def __init__(self, model_path,
                 weights_path,
                 mean_path=None,
                 image_scale=255.0,
                 batch_size=1,
                 input_shape=(227, 227)):

        self.net = caffe.Net(model_path,      # defines the structure of the model
                        weights_path,  # contains the trained weights
                        caffe.TEST)     # use test mode (e.g., don't perform dropout)

        self.net.blobs['data'].reshape(batch_size, 3, input_shape[0], input_shape[1])
        self.net.blobs['prob'].reshape(batch_size, )

        self.mean_path = mean_path
        self.image_scale = image_scale
        self.batch_size = batch_size

        self.transformer = self.set_transformer()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号