@@ -72,12 +72,11 @@ class AdditiveLaplaceNoise(AdditiveElemwise):
...
@@ -72,12 +72,11 @@ class AdditiveLaplaceNoise(AdditiveElemwise):
r"""Add random laplace noise to the input data.
r"""Add random laplace noise to the input data.
Laplace noise is generated with given mean and std, sampled from Laplace distribution
Laplace noise is generated with given mean and std, sampled from Laplace distribution
ref to this page to learn more: https://en.wikipedia.org/wiki/Laplace_distribution
ref to this page to learn more: https://en.wikipedia.org/wiki/Laplace_distribution
Args:
Args:
mean: laplace mean used to generate noise.
mean: laplace mean used to generate noise.
std: laplace standard deviation used to generate noise.
std: laplace standard deviation used to generate noise.
per_channel: Whether to use (imagewise) the same sample(s) for all channels (False) or to sample value(s) for each channel (True). Setting this to True will therefore lead to different transformations per image and channel, otherwise only per image.
per_channel: whether to use (imagewise) the same sample(s) for all channels (False) or to sample value(s) for each channel (True). Setting this to True will therefore lead to different transformations per image and channel, otherwise only per image.
seed: random number seed of generator
seed: random number seed of generator
"""
"""
...
@@ -112,7 +111,7 @@ class AdditivePoissonNoise(AdditiveElemwise):
...
@@ -112,7 +111,7 @@ class AdditivePoissonNoise(AdditiveElemwise):
Args:
Args:
lam: lam parameter of poisson distribution used to generate noise.
lam: lam parameter of poisson distribution used to generate noise.
per_channel: Whether to use (imagewise) the same sample(s) for all channels (False) or to sample value(s) for each channel (True). Setting this to True will therefore lead to different transformations per image and channel, otherwise only per image.
per_channel: whether to use (imagewise) the same sample(s) for all channels (False) or to sample value(s) for each channel (True). Setting this to True will therefore lead to different transformations per image and channel, otherwise only per image.
seed: random number seed of generator
seed: random number seed of generator
"""
"""
...
@@ -143,9 +142,9 @@ class AdditiveGaussianNoise(AdditiveElemwise):
...
@@ -143,9 +142,9 @@ class AdditiveGaussianNoise(AdditiveElemwise):
Gaussian noise is generated with given mean and std.
Gaussian noise is generated with given mean and std.
Args:
Args:
mean: Gaussian mean used to generate noise.
mean: gaussian mean used to generate noise.
std: Gaussian standard deviation used to generate noise.
std: gaussian standard deviation used to generate noise.
per_channel: Whether to use (imagewise) the same sample(s) for all channels (False) or to sample value(s) for each channel (True). Setting this to True will therefore lead to different transformations per image and channel, otherwise only per image.
per_channel: whether to use (imagewise) the same sample(s) for all channels (False) or to sample value(s) for each channel (True). Setting this to True will therefore lead to different transformations per image and channel, otherwise only per image.
seed: random number seed of generator
seed: random number seed of generator
"""
"""
...
@@ -242,8 +241,8 @@ class ActiveBlur(Module):
...
@@ -242,8 +241,8 @@ class ActiveBlur(Module):
returnfloat(param)
returnfloat(param)
elifisinstance(param,tuple):
elifisinstance(param,tuple):
assertlen(param)==2,(
assertlen(param)==2,(
"Expected parameter '%s' with type tuple to have exactly two "
"Expected parameter with type tuple to have exactly two "
"entries, but got %d."%(name,len(param))
"entries, but got %d."%len(param)
)
)
param=self.rng_func(param[0],param[1])
param=self.rng_func(param[0],param[1])
returnfloat(param)
returnfloat(param)
...
@@ -310,7 +309,7 @@ class Emboss(ActiveBlur):
...
@@ -310,7 +309,7 @@ class Emboss(ActiveBlur):
The embossed version pronounces highlights and shadows, enhances the high-frequency information of the image, and retains the low-frequency information of the image
The embossed version pronounces highlights and shadows, enhances the high-frequency information of the image, and retains the low-frequency information of the image
Args:
Args:
alpha: Adjust visibility of embossed images. number or tuple of number, At ``0.0``, only the original image is visible, at ``1.0`` only its embossed version is visible. If a tuple ``(a, b)``, a random value will be sampled from the interval ``[a, b)``.
alpha: adjust visibility of embossed images. number or tuple of number, At ``0.0``, only the original image is visible, at ``1.0`` only its embossed version is visible. If a tuple ``(a, b)``, a random value will be sampled from the interval ``[a, b)``.
strength: emboss strength.Sane values are somewhere in the interval ``[0.0, 2.0)`` with ``1.0``, number or tuple of number, If a tuple ``(a, b)``, a random value will be sampled from the interval ``[a, b)``.
strength: emboss strength.Sane values are somewhere in the interval ``[0.0, 2.0)`` with ``1.0``, number or tuple of number, If a tuple ``(a, b)``, a random value will be sampled from the interval ``[a, b)``.
r"""Sharpen images and alpha-blend the result with the original input.
r"""Sharpen images and alpha-blend the result with the original input.
Args:
Args:
alpha: Adjust visibility of sharpened images. number or tuple of number, At ``0.0``, only the original image is visible, at ``1.0`` only its embossed version is visible. If a tuple ``(a, b)``, a random value will be sampled from the interval ``[a, b)``.
alpha: adjust visibility of sharpened images. number or tuple of number, At ``0.0``, only the original image is visible, at ``1.0`` only its embossed version is visible. If a tuple ``(a, b)``, a random value will be sampled from the interval ``[a, b)``.
lightness: Controls the brightness of sharpened images. Sane values are somewhere in the interval ``[0.5, 2.0)`` with ``1.0``, number or tuple of number, If a tuple ``(a, b)``, a random value will be sampled from the interval ``[a, b)``.
lightness: controls the brightness of sharpened images. Sane values are somewhere in the interval ``[0.5, 2.0)`` with ``1.0``, number or tuple of number, If a tuple ``(a, b)``, a random value will be sampled from the interval ``[a, b)``.
seed: random number seed of generator
seed: random number seed of generator
Examples:
Examples:
...
@@ -440,9 +440,10 @@ class Sharpen(ActiveBlur):
...
@@ -440,9 +440,10 @@ class Sharpen(ActiveBlur):
classLinearContrast(Module):
classLinearContrast(Module):
r"""Adjust contrast by scaling each pixel to ``127 + alpha*(v-127)``.
r"""Adjust contrast by scaling each pixel to ``127 + alpha*(v-127)``.
Args:
Args:
alpha: number or tuple of number. If a tuple ``(a, b)``, a random value will be sampled from the interval ``[a, b)``.
alpha: number or tuple of number. If a tuple ``(a, b)``, a random value will be sampled from the interval ``[a, b)``.
per_channel:Whether to use (imagewise) the same sample(s) for all channels (False) or to sample value(s) for each channel (True). Setting this to True will therefore lead to different transformations per image and channel, otherwise only per image.
per_channel:whether to use (imagewise) the same sample(s) for all channels (False) or to sample value(s) for each channel (True). Setting this to True will therefore lead to different transformations per image and channel, otherwise only per image.
seed: random number seed of generator
seed: random number seed of generator
Examples:
Examples:
...
@@ -468,8 +469,8 @@ class LinearContrast(Module):
...
@@ -468,8 +469,8 @@ class LinearContrast(Module):
returnvalue
returnvalue
elifisinstance(param,tuple):
elifisinstance(param,tuple):
assertlen(param)==2,(
assertlen(param)==2,(
"Expected parameter '%s' with type tuple to have exactly two "
"Expected parameter with type tuple to have exactly two "