mindspore/docs/api/api_python/dataset_vision/mindspore.dataset.vision.Ra...

16 lines
807 B
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.dataset.vision.RandomPosterize
========================================
.. py:class:: mindspore.dataset.vision.RandomPosterize(bits=(8, 8))
随机减少输入图像每个颜色通道的位数。
参数:
- **bits** (Union[int, Sequence[int]], 可选) - 随机位数压缩的范围。位值必须在 [1,8] 范围内,并且在给定范围内至少包含一个整数值。它必须是 (min, max) 或整数格式。
如果min与max相等那么它是一个单一的位数压缩操作默认值(8, 8)。
异常:
- **TypeError** - 如果 `bits` 不是int或Sequence[int]类型。
- **ValueError** - 如果 `bits` 不在 [1, 8] 范围内。
- **RuntimeError** - 如果输入图像的shape不是 <H, W> 或 <H, W, C>。