2022-06-07 15:47:49 +08:00
|
|
|
|
mindspore.dataset.vision.CutMixBatch
|
2022-02-15 15:42:31 +08:00
|
|
|
|
=================================================
|
|
|
|
|
|
|
2022-06-07 15:47:49 +08:00
|
|
|
|
.. py:class:: mindspore.dataset.vision.CutMixBatch(image_batch_format, alpha=1.0, prob=1.0)
|
2022-02-15 15:42:31 +08:00
|
|
|
|
|
2022-03-25 17:23:25 +08:00
|
|
|
|
对输入批次的图像和标注应用剪切混合转换。
|
|
|
|
|
|
请注意,在调用此操作符之前,您需要将标注制作为 one-hot 格式并进行批处理。
|
2022-02-15 15:42:31 +08:00
|
|
|
|
|
2022-07-11 18:56:38 +08:00
|
|
|
|
参数:
|
|
|
|
|
|
- **image_batch_format** (ImageBatchFormat) - 图像批处理输出格式。可以是 [ImageBatchFormat.NHWC、ImageBatchFormat.NCHW] 中的任何一个。
|
|
|
|
|
|
- **alpha** (float, 可选) - β分布的超参数,必须大于0,默认值:1.0。
|
|
|
|
|
|
- **prob** (float, 可选) - 对每个图像应用剪切混合处理的概率,范围:[0.0, 1.0],默认值:1.0。
|
2022-02-15 15:42:31 +08:00
|
|
|
|
|
2022-07-11 18:56:38 +08:00
|
|
|
|
异常:
|
|
|
|
|
|
- **TypeError** - 如果 `image_batch_format` 不是 :class:`mindspore.dataset.vision.ImageBatchFormat` 的类型。
|
|
|
|
|
|
- **TypeError** - 如果 `alpha` 不是float类型。
|
|
|
|
|
|
- **TypeError** - 如果 `prob` 不是 float 类型。
|
|
|
|
|
|
- **ValueError** - 如果 `alpha` 小于或等于 0。
|
|
|
|
|
|
- **ValueError** - 如果 `prob` 不在 [0.0, 1.0] 范围内。
|
|
|
|
|
|
- **RuntimeError** - 如果输入图像的shape不是 <H, W, C>。
|