Add wrappers for imagecorruptions library #530
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch adds wrappers around the functions from
package
https://github.com/bethgelab/imagecorruptions.
The functions in that package were used in some recent
papers and are added here for convenience.
The wrappers produce arrays containing values
identical to the output arrays from the corresponding
imagecorruptions
functions when called via theimagecorruptions.corrupt()
(verified via unittests).The interfaces of the wrapper functions are identical to the
imagecorruptions
functions, with the only difference ofalso supporting
seed
parameters.imgaug.augmenters.imgcorruptlike
.The
like
signals that the augmentation functions donot have to wrap
imagecorruptions
internally.They merely have to produce the same outputs.
imgaug.augmenters.imgcorruptlike
:apply_gaussian_noise()
apply_shot_noise()
apply_impulse_noise()
apply_speckle_noise()
apply_gaussian_blur()
apply_glass_blur()
(improved performance over original function)
apply_defocus_blur()
apply_motion_blur()
apply_zoom_blur()
apply_fog()
apply_snow()
apply_spatter()
apply_contrast()
apply_brightness()
apply_saturate()
apply_jpeg_compression()
apply_pixelate()
apply_elastic_transform()
imgaug.augmenters.imgcorruptlike.get_corruption_names(subset)
.Similar to
imagecorruptions.get_corruption_names(subset)
,but returns a tuple
(list of corruption method names, list of corruption method functions)
,instead of only the names.
imgaug.augmenters.imgcorruptlike
:GaussianNoise
ShotNoise
ImpulseNoise
SpeckleNoise
GaussianBlur
GlassBlur
DefocusBlur
MotionBlur
ZoomBlur
Fog
Frost
Snow
Spatter
Contrast
Brightness
Saturate
JpegCompression
Pixelate
ElasticTransform
imgaug.random.temporary_numpy_seed()
.