跳到主要内容

类说明

类说明​

从Device侧申请内存,获取内存指针地址的值。

父主题: DeviceMemory类

DeviceMemory(int size)​

函数功能​

从Device侧申请内存。

输入参数说明​

参数名类型说明
sizeint申请内存的大小,单位Byte。

返回参数说明​

DeviceMemory对象。

父主题: DeviceMemory类

get_data()​

函数功能​

获取对象中内存指针的值。

返回参数说明​

返回值类型说明
Outputint返回对象内存指针中的值。

父主题: DeviceMemory类

模块说明​

dvpp模块预计于2024年退出,建议使用ImageProcessor类。

父主题: dvpp模块

read_image(inputPath, deviceId, decodeFormat)​

函数功能​

解码读取图片。

输入输出格式及对齐方式请参见decode(inputPath, decodeFormat)。

输入参数说明​

参数名类型说明
inputPathstring图片路径。
deviceIdintDevice设备的ID号。
decodeFormatimage_format枚举类输入图片的解码格式。

返回参数说明​

Image对象。

抛异常接口​

创建ImageProcessor失败、图片解码失败,抛出runtime异常。

父主题: dvpp模块

resize(inputImage, resize, interpolation)​

函数功能​

图像缩放。输入输出范围及对齐方式请参见resize(inputImage, resize, interpolation)。

输入参数说明​

参数名类型说明
inputImageImage类输入缩放前的Image类。
resizeSize类输入图像缩放的宽高。
interpolationInterpolation参数枚举类输入图像的缩放方式,默认为“HUAWEI_HIGH_ORDER_FILTER” 。

返回参数说明​

Image对象。

抛异常接口​

创建ImageProcessor失败、图片缩放失败,抛出runtime异常。

父主题: dvpp模块

batch_concat(inputs)​

函数功能​

将多个Tensor进行组batch,按照第0维组装,内存连续。

输入参数说明​

参数名类型说明
inputsList[base.Tensor]Tensor列表。

输出参数说明​

Tensor对象。

抛异常接口​

传入Tensor异常、组Tensor后输出的Tensor异常,抛出runtime异常。

父主题: 媒体数据处理

在线提单