Cropping and resizing API of the tensor class. It supports asynchronous execution. The tensor memory allocated by calling this API does not need to be managed by the users. It is released by the internal management module.
For details, see Cropping and Resizing.
Only Atlas inference product support this API.
1 | APP_ERROR CropResize(const Tensor &inputTensor, const std::vector<Rect> &cropRectVec, const std::vector<Size> &sizeVec, std::vector<Tensor> &outputTensorVec, const Interpolation interpolation = Interpolation::BILINEAR_SIMILAR_OPENCV, bool keepMargin = false, AscendStream& stream = AscendStream::DefaultStream()); |
Parameter |
Input/Output |
Description |
||
|---|---|---|---|---|
inputTensor |
Input |
Tensor of type UINT8. The value cannot be empty. Memory needs to be allocated on the device or DVPP side. The input tensor width range is [10, 4096], and the height range is [6, 4096]. If the format YUV400 is contained, the width range is [18, 4096]. |
||
cropRectVec |
Input |
List of cropping parameters (Rect class). The number must be the same as that of elements in the output tensor list. |
||
sizeVec |
Input |
List of resizing parameters (Size class). The number must be the same as that of elements in the output tensor list. |
||
outputTensorVec |
Output |
List of tensor classes after cropping and resizing. |
||
interpolation |
Input |
Resizing mode of an input tensor:
The Atlas inference product support the following algorithms (defaulted to 1):
|
||
keepMargin |
Input |
Specifies whether to retain the invalid boundary in the tensor in the outputTensor. The default value is false, indicating that the invalid boundary in the tensor is not reserved. The width and height of the output tensor are the same as those of the resizing width and height. |
||
stream |
Input |
Stream used for asynchronous execution. The default value is AscendStream::DefaultStream(), indicating that a default stream is created (for synchronous execution). |
Data Structure |
Description |
|---|---|
APP_ERROR |
For details about the returned error codes, see APP_ERROR Description. |