conv_filter_visualization.py 文件源码

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

项目:pCVR 作者: xjtushilei 项目源码 文件源码
def deprocess_image(x):
    # normalize tensor: center on 0., ensure std is 0.1
    x -= x.mean()
    x /= (x.std() + 1e-5)
    x *= 0.1

    # clip to [0, 1]
    x += 0.5
    x = np.clip(x, 0, 1)

    # convert to RGB array
    x *= 255
    if K.image_data_format() == 'channels_first':
        x = x.transpose((1, 2, 0))
    x = np.clip(x, 0, 255).astype('uint8')
    return x

# build the VGG16 network with ImageNet weights
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号