CANN/ops-cv算子列表
算子列表
【免费下载链接】ops-cv本项目是CANN提供的图像处理、目标检测相关的算子库,实现网络在NPU上加速计算。项目地址: https://gitcode.com/cann/ops-cv
说明:
- 算子目录:目录名为算子名小写下划线形式,每个目录承载该算子所有交付件,包括代码实现、examples、文档等,目录介绍参见项目目录。
- 算子执行硬件单元:大部分算子运行在AI Core,少部分算子运行在AI CPU。默认情况下,项目中提到的算子一般指AI Core算子。关于AI Core和AI CPU详细介绍参见《Ascend C算子开发》中“概念原理和术语 > 硬件架构与数据处理原理”。
- 算子接口列表:为方便调用算子,CANN提供一套C API执行算子,一般以aclnn为前缀,全量接口参见aclnn列表。
项目提供的所有算子分类和算子列表如下:
| 算子分类 | 算子目录 | 算子实现 | aclnn调用 | 图模式调用 | 算子执行硬件单元 | 说明 | |
|---|---|---|---|---|---|---|---|
| op_kernel | op_host | op_api | op_graph | ||||
| image | aipp | ✓ | ✓ | ✗ | ✓ | AI Core | AIPP(Artificial Intelligence Pre-Processing)人工智能预处理,用于在AI Core上完成数据预处理,包括改变图像尺寸、色域转换(转换图像格式)、减均值/乘系数(改变图像像素),数据预处理之后再进行真正的模型推理。 |
| image | col2im | ✓ | ✓ | ✓ | ✗ | AI Core | 从批处理输入张量中提取滑动局部块,将滑动局部块数组合并为一个大张量。 |
| image | crop_and_resize | ✓ | ✓ | ✗ | ✓ | AI CPU | 从输入图像中提取多个裁剪区域,并将它们统一调整为指定大小,支持双线性插值和最近邻插值。 |
| image | grid_sample | ✓ | ✓ | ✓ | ✓ | AI Core | 提供一个输入tensor以及一个对应的grid网格,然后根据grid中每个位置提供的坐标信息,将input中对应位置的像素值填充到网格指定的位置,得到最终的输出。 |
| image | grid_sampler2_d_grad | ✓ | ✓ | ✓ | ✓ | AI Core | GridSampler中2D场景的反向传播,完成张量input与张量grid的梯度计算。 |
| image | grid_sampler3_d_grad | ✓ | ✓ | ✓ | ✓ | AI Core | GridSampler中3D场景的反向传播,完成张量input与张量grid的梯度计算。 |
| image | image_warp_offsets | ✓ | ✓ | ✗ | ✓ | AI CPU | 根据偏移量选取图像并进行扭曲变换。 |
| image | non_max_suppression_v3 | ✓ | ✓ | ✗ | ✓ | AI CPU | 按照分数递减顺序,采用贪心策略选择候选框(bounding boxes)子集。 |
| image | rasterizer | ✓ | ✓ | ✓ | ✗ | AI Core | 实现光栅化计算。根据给定的三维空间中的点和面,获取屏幕中每个像素点的最小深度及其对应的面片索引,并计算该面片的重心坐标透视矫正插值。 |
| image | resize_bicubic_v2 | ✓ | ✓ | ✗ | ✗ | AI Core | 使用双三次插值调整图像大小到指定的大小。 |
| image | resize_bicubic_v2_grad | ✓ | ✓ | ✗ | ✗ | AI Core | 计算输入图像在双三次插值基础下的梯度。 |
| image | resize_bilinear_v2 | ✓ | ✓ | ✓ | ✗ | AI Core | 使用双线性插值调整图像大小到指定的大小。 |
| image | resize_bilinear_v2_grad | ✓ | ✓ | ✓ | ✗ | AI Core | ResizeBilinearV2的反向传播。 |
| image | resize_linear | ✓ | ✓ | ✗ | ✗ | AI Core | 使用单线性插值调整图像大小到指定的大小。 |
| image | resize_linear_grad | ✓ | ✓ | ✗ | ✗ | AI Core | 计算输入图像在单线性插值基础下的梯度。 |
| image | resize_nearest_neighbor_v2 | ✓ | ✓ | ✓ | ✗ | AI Core | 对由多个输入通道组成的输入信号应用最近邻插值算法进行上采样。 |
| image | resize_upsample_trilinear | ✓ | ✓ | ✓ | ✓ | AI Core | 对由多个输入通道组成的输入信号应用三线性插值算法进行上采样。 |
| image | three_interpolate_backward | ✓ | ✓ | ✓ | ✓ | AI Core | 根据grad_x,idx,weight进行三点插值计算梯度得到grad_y。 |
| image | upsample_bicubic2d | ✓ | ✓ | ✓ | ✓ | AI Core | 对由多个输入通道组成的输入信号应用2D双三次上采样。如果输入Tensorx的shape为(N,C,H,W),则输出Tensorout的shape为(N,C,outputSize[0],outputSize[1])。 |
| image | upsample_bicubic2d_aa | ✓ | ✓ | ✓ | ✓ | AI Core | 对由多个输入通道组成的输入信号应用双三次抗锯齿算法进行上采样。如果输入Tensorx的shape为(N,C,H,W),则输出Tensorout的shape为(N,C,outputSize[0],outputSize[1])。 |
| image | upsample_bicubic2d_aa_grad | ✓ | ✓ | ✓ | ✓ | AI Core | 如果输入张量grad_output的shape为(N,C,H,W),则输出张量grad_input的shape为(N,C,inputSize[2],inputSize[3])。 |
| image | upsample_bicubic2d_grad | ✓ | ✓ | ✓ | ✓ | AI Core | 如果输入张量grad_output的shape为(N,C,H,W),则输出张量grad_input的shape为(N,C,inputSize[2],inputSize[3])。 |
| image | upsample_bilinear2d | ✓ | ✓ | ✓ | ✓ | AI Core | 对由多个输入通道组成的输入信号应用2D双线性上采样。 |
| image | upsample_bilinear2d_aa | ✓ | ✓ | ✓ | ✓ | AI Core | 对由多个输入通道组成的输入信号应用2D双线性抗锯齿采样。 |
| image | upsample_bilinear2d_aa_backward | ✓ | ✓ | ✓ | ✓ | AI Core | UpsampleBilinear2dAA的反向传播。 |
| image | upsample_bilinear2d_grad | ✓ | ✓ | ✓ | ✓ | AI Core | UpsampleBilinear2d的反向传播。 |
| image | upsample_linear1d | ✓ | ✓ | ✓ | ✓ | AI Core | 对由多个输入通道组成的输入信号应用线性插值算法进行上采样。如果输入shape为(N, C, L),则输出shape为(N, C, outputSize)。 |
| image | upsample_nearest | ✓ | ✓ | ✓ | ✓ | AI Core | 对由多个输入通道组成的输入信号应用最近邻插值算法进行上采样。 |
| image | upsample_nearest_exact2d_grad | ✓ | ✓ | ✓ | ✓ | AI Core | [UpsampleNearest](https://link.gitcode.com/i/a06e5e3873ba8e358f13d1c2f435abe7)在exact_mode为true时的反向传播。 |
| image | upsample_nearest_exact3d | ✓ | ✓ | ✓ | ✓ | AI Core | 对由多个输入通道组成的输入信号应用最近邻插值算法进行上采样。 |
| image | upsample_nearest_exact3d_grad | ✓ | ✓ | ✓ | ✓ | AI Core | UpsampleNearestExact3d的反向计算。 |
| image | upsample_nearest2d_grad | ✓ | ✓ | ✓ | ✓ | AI Core | UpsampleNearest在exact_mode为false时的反向传播。 |
| image | upsample_nearest3d | ✓ | ✓ | ✓ | ✓ | AI Core | 对由多个输入通道组成的输入信号应用最近邻插值算法进行上采样。 |
| image | upsample_nearest3d_grad | ✓ | ✓ | ✓ | ✓ | AI Core | UpsampleNearest3d的反向计算。 |
| image | upsample_trilinear3d_backward | ✓ | ✓ | ✓ | ✓ | AI Core | ResizeUpsampleTrilinear的反向计算。 |
| image | spatial_transformer | ✓ | ✓ | ✗ | ✓ | AI Cpu | 用于对输入图像或特征图进行几何变换等操作。 |
| objdetect | mrgba_custom | ✓ | ✓ | ✗ | ✓ | AI Core | 完成张量rgb和张量alpha的透明度乘法计算。 |
| objdetect | blend_images_custom | ✓ | ✓ | ✗ | ✓ | AI Core | 完成张量rgb、frame和alpha的透明度乘法计算。 |
| objdetect | background_replace | ✓ | ✓ | ✗ | ✓ | AI Core | 将输入的新的背景图片与已有图片进行融合,通过掩码的方式将背景替换为新的背景。 |
| objdetect | ciou | ✓ | ✓ | ✗ | ✓ | AI Core | 用于边界框回归的损失函数,在IoU的基础上同时考虑了中心点距离、宽高比和重叠面积,以更全面地衡量预测框与真实框之间的差异。 |
| objdetect | iou_v2 | ✓ | ✓ | ✓ | ✓ | AI Core | 计算两个矩阵的重叠面积占两个矩阵总面积的比例,设预测框的左上角坐标为(X1,Y1),右下角坐标为(X2,Y2),真实框的左上角坐标为(X3,Y3),右下角坐标为(X4,Y4)。 |
| objdetect | non_max_suppression_v6 | ✗ | ✗ | ✓ | ✓ | AI Core | 该算子暂无Ascend C代码实现,欢迎开发者补充贡献,贡献方式参考贡献指南。 |
| objdetect | roi_align | ✗ | ✗ | ✓ | ✓ | AI Core | 该算子暂无Ascend C代码实现,欢迎开发者补充贡献,贡献方式参考贡献指南。 |
| objdetect | roi_align_grad | ✗ | ✗ | ✓ | ✗ | AI Core | 该算子暂无Ascend C代码实现,欢迎开发者补充贡献,贡献方式参考贡献指南。 |
| objdetect | roi_align_rotated | ✓ | ✓ | ✗ | ✗ | AI Core | 用于旋转候选框的ROI对齐池化层。 |
| objdetect | roi_align_rotated_grad | ✓ | ✓ | ✗ | ✗ | AI Core | 通过旋转框各点坐标将梯度回传至对应位置。 |
| objdetect | roi_pooling_with_arg_max | ✓ | ✓ | ✓ | ✗ | AI Core | 对输入特征图按 ROI(感兴趣区域)进行池化,在每个 ROI 内按空间划分格子,对每个格子做最大池化,并输出池化结果及最大值在通道内的一维索引。 |
| objdetect | roi_pooling_grad_with_arg_max | ✓ | ✓ | ✓ | ✗ | AI Core | 遍历每个ROI的池化结果,将feature map坐标上的反向梯度贡献累加,即完成整张图上的反向计算。 |
| objdetect | stack_group_points | ✓ | ✓ | ✗ | ✓ | AI Core | 根据特征点所属的组,重组点云中的特征点。 |
| image | nms_with_mask | ✓ | ✓ | ✗ | ✓ | AI Core | 完成带掩码非极大值抑制计算。 |
【免费下载链接】ops-cv本项目是CANN提供的图像处理、目标检测相关的算子库,实现网络在NPU上加速计算。项目地址: https://gitcode.com/cann/ops-cv
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
