Skip to content

TypeError: gaussian() got an unexpected keyword argument 'multichannel' #30

@danialht

Description

@danialht

I installed this package using pip3 install imagecorruptions but seems that this is not the same as the repository.

When I try this:

img_arr = corrupt(img_arr, severity = 1, corruption_name='gaussian_blur')

I get the error TypeError: gaussian() got an unexpected keyword argument 'multichannel'.
I traced the error and found this in the code for the module corruption.py:

def gaussian_blur(x, severity=1):
    c = [1, 2, 3, 4, 6][severity - 1]

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

Some code is not updated somewhere... gaussian function is is not called with the multichannel argument (looking at the repository) instead it is called with channel_axis=-1.

After manually changing this line to the, the code works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions