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

19 lines
656 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.nn.CentralCrop
=========================
.. py:class:: mindspore.nn.CentralCrop(central_fraction)
根据指定比例裁剪出图像的中心区域。
参数:
- **central_fraction** (float) - 裁剪比例必须是float并且在范围(0.0, 1.0]内。
输入:
- **image** (Tensor) - shape为 :math:`(C, H, W)` 的三维Tensor或shape为 :math:`(N,C,H,W)` 的四维Tensor。
输出:
Tensor基于输入的三维或四维的float Tensor。
异常:
- **TypeError** - `central_fraction` 不是float。
- **ValueError** - `central_fraction` 不在范围(0.0, 1.0]内。