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

Fix crashes in numpy 1.18 #534

Merged
merged 1 commit into from
Dec 22, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelogs/master/fixed/20191222_fixed_numpy_1_18.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Fixed crashes in numpy 1.18 #534

* Fixed `imgaug.random.normalize_generator()` crashing in numpy 1.18.
The function relied on `numpy.random.bit_generator.BitGenerator`, which
was moved in numpy 1.18 to `numpy.random.BitGenerator` without a
deprecation period for the old name.
2 changes: 1 addition & 1 deletion imgaug/augmentables/polys.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def recover_psois_(psois, psois_orig, recoverer, random_state):
recoverer : imgaug.augmentables.polys._ConcavePolygonRecoverer
The polygon recoverer used to repair broken input polygons.

random_state : None or int or RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState
random_state : None or int or RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState
An RNG to use during the polygon recovery.

Returns
Expand Down
46 changes: 23 additions & 23 deletions imgaug/augmenters/arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ class Add(meta.Augmenter):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -1387,7 +1387,7 @@ class AddElementwise(meta.Augmenter):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -1514,7 +1514,7 @@ class AdditiveGaussianNoise(AddElementwise):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -1626,7 +1626,7 @@ class AdditiveLaplaceNoise(AddElementwise):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -1727,7 +1727,7 @@ class AdditivePoissonNoise(AddElementwise):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -1818,7 +1818,7 @@ class Multiply(meta.Augmenter):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -1950,7 +1950,7 @@ class MultiplyElementwise(meta.Augmenter):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -2076,7 +2076,7 @@ class Dropout(MultiplyElementwise):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -2256,7 +2256,7 @@ class CoarseDropout(MultiplyElementwise):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -2379,7 +2379,7 @@ class Dropout2d(meta.Augmenter):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -2555,7 +2555,7 @@ class TotalDropout(meta.Augmenter):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -2696,7 +2696,7 @@ class ReplaceElementwise(meta.Augmenter):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -2840,7 +2840,7 @@ class SaltAndPepper(ReplaceElementwise):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -2901,7 +2901,7 @@ class ImpulseNoise(SaltAndPepper):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -3015,7 +3015,7 @@ class CoarseSaltAndPepper(ReplaceElementwise):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -3112,7 +3112,7 @@ class Salt(ReplaceElementwise):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -3229,7 +3229,7 @@ class CoarseSalt(ReplaceElementwise):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -3322,7 +3322,7 @@ class Pepper(ReplaceElementwise):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -3437,7 +3437,7 @@ class CoarsePepper(ReplaceElementwise):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -3561,7 +3561,7 @@ class Invert(meta.Augmenter):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -3736,7 +3736,7 @@ class Solarize(Invert):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -3802,7 +3802,7 @@ def ContrastNormalization(alpha=1.0, per_channel=False,
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -3876,7 +3876,7 @@ class JpegCompression(meta.Augmenter):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down
2 changes: 1 addition & 1 deletion imgaug/augmenters/artistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ class Cartoon(meta.Augmenter):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down
8 changes: 4 additions & 4 deletions imgaug/augmenters/blend.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class Alpha(meta.Augmenter):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -535,7 +535,7 @@ class AlphaElementwise(Alpha):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -910,7 +910,7 @@ class SimplexNoiseAlpha(AlphaElementwise):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down Expand Up @@ -1136,7 +1136,7 @@ class FrequencyNoiseAlpha(AlphaElementwise):
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

Examples
Expand Down