Skip to content

Commit

Permalink
Fix badphotocopy
Browse files Browse the repository at this point in the history
  • Loading branch information
MarieRoald committed Sep 23, 2024
1 parent adeb303 commit d554967
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions augraphy/augmentations/badphotocopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,18 @@ def __init__(
# clamp values
# noise value range from 0-255
self.noise_value = list(self.noise_value)
self.noise_value[0] = np.clip(self.noise_value[0], 0, 255)
self.noise_value[1] = np.clip(self.noise_value[1], 0, 255)
self.noise_value[0] = np.clip(self.noise_value[0], 0, 255).item()
self.noise_value[1] = np.clip(self.noise_value[1], 0, 255).item()

# sparsity range from 0-1
self.noise_sparsity = list(self.noise_sparsity)
self.noise_sparsity[0] = np.clip(self.noise_sparsity[0], 0, 1)
self.noise_sparsity[1] = np.clip(self.noise_sparsity[1], 0, 1)
self.noise_sparsity[0] = np.clip(self.noise_sparsity[0], 0, 1).item()
self.noise_sparsity[1] = np.clip(self.noise_sparsity[1], 0, 1).item()

# concentration range from 0-1
self.noise_concentration = list(self.noise_concentration)
self.noise_concentration[0] = np.clip(self.noise_concentration[0], 0, 1)
self.noise_concentration[1] = np.clip(self.noise_concentration[1], 0, 1)
self.noise_concentration[0] = np.clip(self.noise_concentration[0], 0, 1).item()
self.noise_concentration[1] = np.clip(self.noise_concentration[1], 0, 1).item()

# Constructs a string representation of this Augmentation.
def __repr__(self):
Expand Down

0 comments on commit d554967

Please sign in to comment.