Skip to content

Commit

Permalink
Update to new skimage version
Browse files Browse the repository at this point in the history
- multichannel argument in function gaussian is deprecated, replaced it
with channel_axis=-1
  • Loading branch information
Tim Hotfilter committed May 10, 2023
1 parent c8c1828 commit a62c83b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions imagecorruptions/corruptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def speckle_noise(x, severity=1):
def gaussian_blur(x, severity=1):
c = [1, 2, 3, 4, 6][severity - 1]

x = gaussian(np.array(x) / 255., sigma=c, multichannel=True)
x = gaussian(np.array(x) / 255., sigma=c, channel_axis=-1)
return np.clip(x, 0, 1) * 255


Expand All @@ -210,11 +210,11 @@ def glass_blur(x, severity=1):
severity - 1]

x = np.uint8(
gaussian(np.array(x) / 255., sigma=c[0], multichannel=True) * 255)
gaussian(np.array(x) / 255., sigma=c[0], channel_axis=-1) * 255)

x = _shuffle_pixels_njit_glass_blur(np.array(x).shape[0],np.array(x).shape[1],x,c)

return np.clip(gaussian(x / 255., sigma=c[0], multichannel=True), 0,
return np.clip(gaussian(x / 255., sigma=c[0], channel_axis=-1), 0,
1) * 255

def defocus_blur(x, severity=1):
Expand Down

0 comments on commit a62c83b

Please sign in to comment.