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

Improve Warnings on Probably-Wrong Image Inputs #594

Merged
merged 11 commits into from
Jan 25, 2020
Merged

Conversation

aleju
Copy link
Owner

@aleju aleju commented Jan 25, 2020

Improve the errors and warnings on image augmentation calls.
augment_image() will now produce a more self-explanatory error
message when calling it as in augment_image(list of images).
Calls of single-image augmentation functions (e.g.
augment(image=...)) with inputs that look like multiple images
will now produce warnings. This is the case for (H, W, C)
inputs when C>=32 (as that indicates that (N, H, W) was
actually provided).
Calls of multi-image augmentation functions (e.g.
augment(images=...)) with inputs that look like single images
will now produce warnings. This is the case for (N, H, W)
inputs when W=1 or W=3 (as that indicates that (H, W, C)
was actually provided.)

  • Add an assert in augment_image() to verify that inputs are
    arrays.
  • Add warnings for probably-wrong image inputs in
    augment_image(), augment_images(), augment() (and its
    alias __call__()).
  • Add module imgaug.augmenters.base.
  • Add warning
    imgaug.augmenters.base.SuspiciousMultiImageShapeWarning.
  • Add warning
    imgaug.augmenters.base.SuspiciousSingleImageShapeWarning.
  • Add imgaug.testutils.assertWarns, similar to unittest's
    assertWarns, but available in python <3.2.

@codecov-io
Copy link

codecov-io commented Jan 25, 2020

Codecov Report

Merging #594 into master will decrease coverage by 0.15%.
The diff coverage is 75.25%.

@@            Coverage Diff             @@
##           master     #594      +/-   ##
==========================================
- Coverage   96.49%   96.35%   -0.15%     
==========================================
  Files          40       41       +1     
  Lines       14550    14648      +98     
==========================================
+ Hits        14040    14113      +73     
- Misses        510      535      +25

@aleju aleju merged commit 07df30f into master Jan 25, 2020
@aleju aleju deleted the improve_images_warnings branch January 25, 2020 13:48
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.

2 participants