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 Cutout augmenter #531

Merged
merged 1 commit into from
Jan 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions changelogs/master/added/20191220_cutout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Cutout Augmenter #531

* Added `imgaug.augmenters.arithmetic.apply_cutout_()`, which replaces
in-place a single rectangular area with a constant intensity value or a
constant color or gaussian noise.
See also the [paper](https://arxiv.org/abs/1708.04552) about Cutout.
* Added `imgaug.augmenters.arithmetic.apply_cutout()`. Same as
`apply_cutout_()`, but copies the input images before applying cutout.
* Added `imgaug.augmenters.arithmetic.Cutout`.
15 changes: 15 additions & 0 deletions checks/check_cutout.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from __future__ import print_function, division, absolute_import
import imgaug as ia
import imgaug.augmenters as iaa


def main():
aug = iaa.Cutout(fill_mode=["gaussian", "constant"], cval=(0, 255),
fill_per_channel=0.5)
image = ia.quokka()
images_aug = aug(images=[image] * 16)
ia.imshow(ia.draw_grid(images_aug, cols=4, rows=4))


if __name__ == "__main__":
main()
Loading