# 4. 人脸图像检测

\*\*功能描述:\*\*用于对图片进行多维度的质量检测。

| 一级参数           | 二级参数               | 类型     | 默认值 | 选择     | 说明                                              | 举例                                     |
| -------------- | ------------------ | ------ | --- | ------ | ----------------------------------------------- | -------------------------------------- |
| method         |                    | string | 无   | **必选** | fiqa                                            | "fiqa"                                 |
| messageId      |                    | string | 无   | 可选     | MQ消息的唯一标识ID                                     | “004a5b58-32e8-487e-a90a-2ce443877e7e” |
| info           |                    | dict   | 无   | **必选** | 包含图片数据                                          |                                        |
|                | image\_base64\_str | string | 无   | **必选** | 图片base64转换格式                                    |                                        |
|                | fiqa\_level        | string | 无   | 可选，可为空 | 质量检测级别，共high，custom, middle，low，no 5个级别，默认为high |                                        |
| extend\_params |                    | dict   | 无   | **必选** | 扩展字段，可以为空                                       |                                        |

**MQ命令示例：**

```json
{
    "method": "fiqa", // 此关键字和内容不能变
    "messageId":"adjfqk34j5l2h3loadshfl",  //MQ消息的唯一标识ID
    "info":{
        "image_base64_str":"xxxx",  //base64格式图片数据
        "fiqa_level":"high"   //质量检测级别，默认为high
    }
 
    "extend_params": {
    }  // 扩展字段，当前为空。用于将来的接口升级。扩展字段的内容以字典的形式填充，但扩展字段本身为必选。   
}
```

**返回结果示例：**

```json
{
    "success":true,                //成功时候返回true，失败返回false
    "code":0,                      //调用成功返回0
    "message":"检测图片质量MQ命令执行成功",
    "dev_sno":"sfgwe12341" ,       //设备唯一标识key
    "messageKey":"fiqa" ,          //每一类消息格式的key
    "messageId":"adjfqk34j5l2h3loadshfl",  //MQ消息的唯一标识ID
    "result":{
            "data":[{
                "bbox": [          //人脸检测框坐标x1,y1,x2,y2
                    103,
                    78,
                    514,
                    609
                ],
                "fails": [],
                "fiqa_result": true,        //图像质量检测结果
                "info": {
                    "brightness": 0.9496459238842202,   //明暗度
                    "clarity": 1.4716458509372252,      //清晰度
                    "face_size": 354,                   //人脸大小
                    "headpose": {                       //人脸角度
                        "pitch_angle": 9.38,
                        "roll_angle": -0.05,
                        "yaw_angle": -1.63
                        },
                    "mask": 0.0036406677681952715,       
                    "occlusion": [                     //遮挡
                        true,
                        true,
                        true
                        ],
                    "partial": false				//部分人脸
                },
                "score": 1.4716458509372252,            //图像质量检测分数
                "success": [                            //检测成功包含的返回字段
                    "face_size",
                    "headpose",
                    "occlusion",
                    "clarity",
                    "mask",
                    "partial",
                    "brightness"
                ]， 
            } ]                                                                                  
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bm168x.gitbook.io/project/v5r6c01_readme/xi-tong-dui-jie-shuo-ming-shu/dui-jie-se3-he-zi/3.2.3-yong-hu-guan-li/5.3-ren-lian-tu-pian-zhi-liang-jian-ce-fiqamq-xiao-xi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
