Fix random noise corruptor

It was functioning as a color shift
This commit is contained in:
James Betker 2020-09-27 11:12:24 -06:00
parent c85da79697
commit d8c3fc9327

View File

@ -78,7 +78,7 @@ class ImageCorruptor:
elif 'noise' in aug:
# Block noise
noise_intensity = (rand_int % 4 + 2) / 255.0 # Between 1-4
img += np.random.randn() * noise_intensity
img += np.random.randn(*img.shape) * noise_intensity
elif 'jpeg' in aug:
# JPEG compression
qf = (rand_int % 20 + 5) # Between 5-25