def add_noise(x_clean, noise_factor):
x = x_clean.copy()
x_shape = x.shape
x = x + noise_factor * 255 * (np.random.normal(loc=0.0, scale=1.0, size=x_shape) + 1) / 2
x_noisy = np.clip(x, 0., 255.)
return x_noisy
# converts image list to a normed image list (used as input for NN)
QuickDraw_noisy_classifier.py 文件源码
python
阅读 32
收藏 0
点赞 0
评论 0
评论列表
文章目录