imgaug.dtypes

Functions to interact/analyze with numpy dtypes.

imgaug.dtypes.allow_only_uint8(dtypes, augmenter=None)[source]

Verify that input dtypes are uint8.

Added in 0.5.0.

Parameters:
  • dtypes (numpy.ndarray or iterable of numpy.ndarray or iterable of numpy.dtype) – One or more input dtypes to verify.

  • augmenter (None or imgaug.augmenters.meta.Augmenter, optional) – If the gating happens for an augmenter, it should be provided here. This information will be used to improve output error messages and warnings.

imgaug.dtypes.change_dtype_(arr, dtype, clip=True, round=True)[source]
imgaug.dtypes.change_dtypes_(images, dtypes, clip=True, round=True)[source]
imgaug.dtypes.clip_(array, min_value, max_value)[source]
imgaug.dtypes.clip_to_dtype_value_range_(array, dtype, validate=True, validate_values=None)[source]
imgaug.dtypes.copy_dtypes_for_restore(images, force_list=False)[source]
imgaug.dtypes.gate_dtypes(dtypes, allowed, disallowed, augmenter=None)[source]

Deprecated. Use imgaug.dtypes.gate_dtypes_strs instead.

imgaug.dtypes.gate_dtypes_strs(dtypes, allowed, disallowed, augmenter=None)[source]

Verify that input dtypes match allowed/disallowed dtype strings.

Added in 0.5.0.

Parameters:
  • dtypes (numpy.ndarray or iterable of numpy.ndarray or iterable of numpy.dtype) – One or more input dtypes to verify.

  • allowed (str) – Names of one or more allowed dtypes, separated by single spaces.

  • disallowed (str) – Names of disallowed dtypes, separated by single spaces. Must not intersect with allowed dtypes.

  • augmenter (None or imgaug.augmenters.meta.Augmenter, optional) – If the gating happens for an augmenter, it should be provided here. This information will be used to improve output error messages and warnings.

imgaug.dtypes.get_minimal_dtype(arrays, increase_itemsize_factor=1)[source]
imgaug.dtypes.get_value_range_of_dtype(dtype)[source]
imgaug.dtypes.increase_array_resolutions_(arrays, factor)[source]
imgaug.dtypes.increase_itemsize_of_dtype(dtype, factor)[source]
imgaug.dtypes.normalize_dtype(dtype)[source]
imgaug.dtypes.normalize_dtypes(dtypes)[source]
imgaug.dtypes.promote_array_dtypes_(arrays, dtypes=None, increase_itemsize_factor=1)[source]
imgaug.dtypes.restore_dtypes_(images, dtypes, clip=True, round=True)[source]