style_transfer.py 文件源码

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

项目:style_transfer 作者: crowsonkb 项目源码 文件源码
def __init__(self, deploy, weights, mean=(0, 0, 0), shapes=None, placeholder=False):
        self.deploy = deploy
        self.weights = weights
        self.mean = np.float32(mean).reshape((3, 1, 1))
        self.bgr = True
        self.shapes = shapes
        self.last_layer = None
        if shapes:
            self.last_layer = list(shapes)[-1]
        if not placeholder:
            import caffe
            self.net = caffe.Net(self.deploy, 1, weights=self.weights)
            self.data = LayerIndexer(self.net, 'data')
            self.diff = LayerIndexer(self.net, 'diff')
        self.contents = []
        self.styles = []
        self.img = None
        self._arr_pool = ArrayPool()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号