---
title: 函数：get_first_aipp_info
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/aclpythondevg_01_0215.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/aclpythondevg_01_0215.html
indexId: 07a0d0a3b410cc8ca2eb689441566911cb9d20ddf4ea3efe6574cacf17491e1f75
---
# 函数：get_first_aipp_info

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | x |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |


#### 功能说明

获取模型AIPP（包括静态AIPP和动态AIPP）的配置信息。

AIPP支持的几种操作的计算方式及其计算顺序如下：

1. 抠图
2. 色域转换
3. 缩放（当前版本不支持缩放）
4. 减均值/归一化
5. 补边


#### 函数原型

- C函数原型
  1 aclError aclmdlGetFirstAippInfo(uint32_t modelId, size_t index, aclAippInfo *aippInfo)

- python函数
  1 aipp_info, ret = acl.mdl.get_first_aipp_info(model_id, index)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| model\_id | int，模型ID。 可在以下接口成功加载模型后获取到模型ID。 acl.mdl.load\_from\_file acl.mdl.load\_from\_mem acl.mdl.load\_from\_file\_with\_mem acl.mdl.load\_from\_mem\_with\_mem |
| index | int，指定模型的第几个输入。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| aipp\_info | dict，获取指定输入上静态AIPP的配置信息，具体请参见aclAippInfo。 详细说明及参数解释，请参考《ATC离线模型编译工具(https://www.hiascend.com/document/detail/zh/canncommercial/900/devaids/atctool/atlasatc\_16\_0001.html)》。 |
| ret | int，错误码。 返回0表示成功。 返回其它值(https://www.hiascend.comdocument/detail/zh/canncommercial/900/API/runtimeapi/aclpythondevg\_01\_0911.html)表示失败。 |


#### 约束说明

如果使用本接口获取模型中动态AIPP的信息，只能获取“aipp_info”中如下参数的值：srcFormat、srcDatatype、srcDimNum、shapeCount、outDims，其它参数值无效。
