Skip to content

Commit

Permalink
Merge pull request #432 from kwcckw/dev
Browse files Browse the repository at this point in the history
Fixed bug in NoiseTexturize.
  • Loading branch information
kwcckw authored Apr 2, 2024
2 parents 2a36dba + f78eab4 commit 4132722
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions augraphy/augmentations/noisetexturize.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,14 @@ def __call__(self, image, layer=None, mask=None, keypoints=None, bounding_boxes=
image, image_alpha = image[:, :, :3], image[:, :, 3]

sigma = random.randint(self.sigma_range[0], self.sigma_range[1])
turbulence = random.randint(
self.turbulence_range[0],
self.turbulence_range[1],

# turbulence must > 1 to prevent endless while loop below
turbulence = max(
2,
random.randint(
self.turbulence_range[0],
self.turbulence_range[1],
),
)

result = image.astype(float)
Expand Down

0 comments on commit 4132722

Please sign in to comment.