Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wrappers for imagecorruptions library #530

Merged
merged 1 commit into from
Jan 11, 2020
Merged

Add wrappers for imagecorruptions library #530

merged 1 commit into from
Jan 11, 2020

Conversation

aleju
Copy link
Owner

@aleju aleju commented Dec 18, 2019

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 the
imagecorruptions.corrupt() (verified via unittests).
The interfaces of the wrapper functions are identical to the
imagecorruptions functions, with the only difference of
also supporting seed parameters.

  • Add module imgaug.augmenters.imgcorruptlike.
    The like signals that the augmentation functions do
    not have to wrap imagecorruptions internally.
    They merely have to produce the same outputs.
  • Add the following functions to module
    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()
  • Add function
    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.
  • Add the following augmenters to module
    imgaug.augmenters.imgcorruptlike:
    • GaussianNoise
    • ShotNoise
    • ImpulseNoise
    • SpeckleNoise
    • GaussianBlur
    • GlassBlur
    • DefocusBlur
    • MotionBlur
    • ZoomBlur
    • Fog
    • Frost
    • Snow
    • Spatter
    • Contrast
    • Brightness
    • Saturate
    • JpegCompression
    • Pixelate
    • ElasticTransform
  • Add context imgaug.random.temporary_numpy_seed().

@codecov-io
Copy link

codecov-io commented Dec 18, 2019

Codecov Report

Merging #530 into master will increase coverage by 0.06%.
The diff coverage is 97.07%.

@@            Coverage Diff            @@
##           master    #530      +/-   ##
=========================================
+ Coverage   96.44%   96.5%   +0.06%     
=========================================
  Files          38      40       +2     
  Lines       13974   14441     +467     
=========================================
+ Hits        13477   13936     +459     
- Misses        497     505       +8

@aleju aleju force-pushed the imagecorruptions branch 3 times, most recently from df8433f to 84744c2 Compare December 22, 2019 22:05
@aleju aleju changed the title [WIP] Add wrapper around imagecorruptions Add wrappers around imagecorruptions Dec 22, 2019
@aleju aleju force-pushed the imagecorruptions branch 2 times, most recently from 4b02159 to 6bf9fc7 Compare December 23, 2019 15:40
@aleju aleju force-pushed the imagecorruptions branch 2 times, most recently from 87ac0fc to a74fe97 Compare January 11, 2020 16:58
@aleju aleju changed the title Add wrappers around imagecorruptions Add wrappers for imagecorruptions library Jan 11, 2020
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 the
`imagecorruptions.corrupt()` (verified via unittests).
The interfaces of the wrapper functions are identical to the
`imagecorruptions` functions, with the only difference of
also supporting `seed` parameters.

* Add module `imgaug.augmenters.imgcorruptlike`.
  The `like` signals that the augmentation functions do
  not *have* to wrap `imagecorruptions` internally.
  They merely have to produce the same outputs.
* Add the following functions to module
  `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()`
* Add function
  `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.
* Add the following augmenters to module
  `imgaug.augmenters.imgcorruptlike`:
    * `GaussianNoise`
    * `ShotNoise`
    * `ImpulseNoise`
    * `SpeckleNoise`
    * `GaussianBlur`
    * `GlassBlur`
    * `DefocusBlur`
    * `MotionBlur`
    * `ZoomBlur`
    * `Fog`
    * `Frost`
    * `Snow`
    * `Spatter`
    * `Contrast`
    * `Brightness`
    * `Saturate`
    * `JpegCompression`
    * `Pixelate`
    * `ElasticTransform`
* Add context `imgaug.random.temporary_numpy_seed()`.
@aleju aleju merged commit 92048b8 into master Jan 11, 2020
@aleju aleju deleted the imagecorruptions branch January 11, 2020 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants