Improve Warnings on Probably-Wrong Image Inputs #594
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.
Improve the errors and warnings on image augmentation calls.
augment_image()
will now produce a more self-explanatory errormessage 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 imageswill now produce warnings. This is the case for
(H, W, C)
inputs when
C>=32
(as that indicates that(N, H, W)
wasactually provided).
Calls of multi-image augmentation functions (e.g.
augment(images=...)
) with inputs that look like single imageswill now produce warnings. This is the case for
(N, H, W)
inputs when
W=1
orW=3
(as that indicates that(H, W, C)
was actually provided.)
augment_image()
to verify that inputs arearrays.
augment_image()
,augment_images()
,augment()
(and itsalias
__call__()
).imgaug.augmenters.base
.imgaug.augmenters.base.SuspiciousMultiImageShapeWarning
.imgaug.augmenters.base.SuspiciousSingleImageShapeWarning
.imgaug.testutils.assertWarns
, similar tounittest
'sassertWarns
, but available in python <3.2.