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
denoise_autoencoder.py 文件源码
python
阅读 37
收藏 0
点赞 0
评论 0
评论列表
文章目录