processing.py 文件源码

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

项目:deep-lossy-fun 作者: PetarV- 项目源码 文件源码
def deprocess_and_save(x, img_path):
    # Remove the batch dimension
    x = np.squeeze(x)

    # Restore the mean values on each channel
    x[:, :, 0] += 103.939
    x[:, :, 1] += 116.779
    x[:, :, 2] += 123.68

    # BGR --> RGB
    x = x[:, :, ::-1]

    # Clip unprintable colours
    x = np.clip(x, 0, 255).astype('uint8')

    # Save the image
    imsave(img_path, x)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号