mindspore/docs/api/api_python/nn/mindspore.nn.CentralCrop.rst

19 lines
656 B
ReStructuredText
Raw Normal View History

mindspore.nn.CentralCrop
=========================
.. py:class:: mindspore.nn.CentralCrop(central_fraction)
根据指定比例裁剪出图像的中心区域。
2022-07-22 16:25:38 +08:00
参数:
- **central_fraction** (float) - 裁剪比例必须是float并且在范围(0.0, 1.0]内。
2022-07-22 16:25:38 +08:00
输入:
- **image** (Tensor) - shape为 :math:`(C, H, W)` 的三维Tensor或shape为 :math:`(N,C,H,W)` 的四维Tensor。
2022-07-22 16:25:38 +08:00
输出:
Tensor基于输入的三维或四维的float Tensor。
2022-07-22 16:25:38 +08:00
异常:
- **TypeError** - `central_fraction` 不是float。
- **ValueError** - `central_fraction` 不在范围(0.0, 1.0]内。