denoise_autoencoder.py 文件源码

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

项目:road-segmentation 作者: paramoecium 项目源码 文件源码
def _reconstruction(img_data, size):
    """
    Reconstruct single image from flattened array, function replaces values, so good for visualising the corruption process
    Args:
        img_data: flattened image array
        type: size of the image (rescaled)
    Returns:
        recontructed image
    """
    patches_per_dim = size - conf.patch_size + 1

    print("size: {}".format(size))
    print("patches_per_dim: {}".format(patches_per_dim))
    print("img_data: {}".format(img_data.shape))
    reconstruction = np.zeros((size,size))
    idx = 0
    for i in range(patches_per_dim):
        for j in range(patches_per_dim):
            reconstruction[i:(i+conf.patch_size),j:(j+conf.patch_size)] =  img_data[idx,:].reshape(conf.patch_size, conf.patch_size)
            idx += 1
    return reconstruction
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号