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

20 lines
1020 B
ReStructuredText
Raw Permalink 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.CutOut
============================================
.. py:class:: mindspore.dataset.vision.CutOut(length, num_patches=1, is_hwc=True)
从输入图像数组中随机裁剪出给定数量的正方形区域。
参数:
- **length** (int) - 每个正方形区域的边长,必须大于 0。
- **num_patches** (int, 可选) - 要从图像中切出的正方形区域数必须大于0。默认值1。
- **is_hwc** (bool, 可选) - 表示输入图像是否为HWC格式True为HWC格式False为CHW格式。默认值True。
异常:
- **TypeError** - 如果 `length` 不是int类型。
- **TypeError** - 如果 `num_patches` 不是int类型。
- **TypeError** - 如果 `is_hwc` 不是bool类型。
- **ValueError** - 如果 `length` 小于或等于 0。
- **ValueError** - 如果 `num_patches` 小于或等于 0。
- **RuntimeError** - 如果输入图像的shape不是 <H, W, C>。