用户在回调模板中配置AI事件通知回调URL,并将该回调模板绑定至设备,智能视图服务将实时推送AI告警信息,如人员布控、烟雾明火、入侵检测等AI算法告警。
说明:用户需创建AI应用绑定至设备并启用,当该设备画面触发AI告警事件时,智能视图服务将推送AI告警信息至用户配置的AI事件通知回调URL。
回调消息参数
| 参数 | 类型 | 描述 | 下级对象 |
|---|
| EventType | Integer | AI事件类型。 取值:5。 | |
| Expires | Integer | 回调消息的失效时间点,1970 年 1 月 1 日以来的秒数。 说明:来自天翼云的消息通知默认过期时间是10分钟,如果一条消息通知中的Expires值所指定的时间已经过期,则可以判定这条通知无效,进而可以防止网络重放攻击。 | |
| Signature | String | 回调消息的安全签名,Signature=MD5(CallbackKey+Expires)。 说明:天翼云把CallbackKey和Expires进行字符串拼接后通过MD5计算得出Signature值,并将其放在回调消息里,您的后台服务器在收到通知消息后可以根据同样的算法确认Signature是否正确,进而确认消息是否来自天翼云。 | |
| DeviceId | String | 设备ID。 | |
| GbId | String | 设备国标ID。 | |
| DeviceName | String | 设备名称。 | |
| AIType | Integer | AI算法类型。 取值: 5:吸烟检测 7:安全帽反光服检测 8:行人检测 9:危险区域检测 10:烟雾明火检测 12:人体属性检测 17:车牌识别 19:入侵检测 23:电动车检测 24:车辆违停检测 25:车辆拥堵检测 26:人群感应检测 27:实时在岗检测 31:跌倒检测 34:人脸识别 37:城市治理 | |
| Data | Object | AI告警信息,不同的AIType,Data内容不同,参考下面的表格详情。 | Data |
| ImageUrl | String | AI告警图片Url,可以下载。 | |
| EventTime | Integer | 事件消息产生的时间戳,单位秒。 | |
表 Data
吸烟检测
| 参数 | 类型 | 描述 | 下级对象 |
|---|
| DetectBoxes | Array of Integers | 返回检测矩形框,矩形框坐标是box=[left, top,width, height]。如有多个矩形框则返回[box0, box1]。 | |
| DetectScores | Array of Floats | 返回检测框的置信度,范围是0-1。 | |
| DetectClses | Array of Integers | 返回目标类别。0 :未吸烟,1:吸烟。 | |
安全帽反光服检测
| 参数 | 类型 | 描述 | 下级对象 |
|---|
| DetectBoxes | Array of Integers | 返回行人检测矩形框,矩形框坐标是box =[left,top,width, height]。如有多个矩形框则返回[box0,box1]。 | |
| DetectScores | Array of Floats | 返回检测框的置信度分数,范围是0-1。 | |
| DetectClses | Array of Integers | 返回检测框的类别。0:穿反光服,1:未穿反光服,2:未戴安全帽,3:戴安全帽。 | |
行人检测
| 参数 | 类型 | 描述 | 下级对象 |
|---|
| DetectBoxes | Array of Integers | 返回目标检测矩形框,矩形框坐标是box =[left, top, width, height]。如有多个矩形框则返回[box0, box1]。 | |
| DetectScores | Array of Floats | 返回目标框的置信度,范围是 0-1。 | |
| DetectClses | Array of Integers | 返回目标框的类别。0:行人。 | |
危险区域检测
| 参数 | 类型 | 描述 | 下级对象 |
|---|
| DetectBoxes | Array of Integers | 返回行人检测矩形框,矩形框坐标是 box =[left,top,width, height]。如有多个矩形框则返回[box0,box1]。 | |
| DetectScores | Array of Floats | 返回目标框的置信度,范围是 0-1。 | |
| DetectClses | Array of Integers | 返回目标框的类别。0:行人。 | |
烟雾明火检测
| 参数 | 类型 | 描述 | 下级对象 |
|---|
| DetectBoxes | Array of Integers | 返回检测矩形框,矩形框坐标是 box =[left,top,width, height]。如有多个矩形框则返回[box0,box1]。 | |
| DetectScores | Array of Floats | 返回目标框的置信度,范围是 0-1。 | |
| DetectClses | Array of Integers | 返回目标框的类别。1:明火,2:烟雾。 | |
车牌识别
| 参数 | 类型 | 描述 | 下级对象 |
|---|
| Boxes | Array of Integers | 返回检测的车牌矩形框坐标,矩形框坐标是顺时针左上、右上、右下、左下。 | |
| Texts | Array of Strings | 返回检测的车牌号码。 | |
入侵检测
| 参数 | 类型 | 描述 | 下级对象 |
|---|
| FaceCount | Integer | 返回检测的人脸个数。 | |
| FaceRectangles | Array of Integers | 返回人脸矩形框,分别是[left, top, width, height]。如有多个人脸,则按顺序返回矩形框。例如有两个人脸则返回[left1, top1, width1, height1, left2, top2, width2, height2]。 | |
| MatchList | Array of Objects | 返回匹配的结果列表,如果输入图像中有多个人脸,则会返回多个人脸数据。 | FaceItemData |
表 FaceItemData
| 参数 | 类型 | 描述 | 下级对象 |
|---|
| Location | Object | 返回人脸坐标信息。 | Locate |
| FaceItems | Array of Objects | 返回匹配的人脸数据列表。 | FaceInfo |
表 FaceInfo
| 参数 | 类型 | 描述 | 下级对象 |
|---|
| DbName | String | 返回匹配到的人脸库名称。 | |
| FaceId | String | 返回人脸ID。 | |
| EntityId | String | 返回实体 ID,用来标识用户的唯一性。 | |
| Score | Float | 返回人脸相似度得分,取值范围 0-100,数值越大相似度越高。 | |
| ExtraData | String | 返回其他信息。 | |
| Labels | String | 返回人员标签,包括人员姓名等。 | |
表 Locate
| 参数 | 类型 | 描述 | 下级对象 |
|---|
| Height | Integer | 高度,单位像素。 | |
| Width | Integer | 宽度,单位像素。 | |
| X | Integer | 左上角x坐标。 | |
| Y | Integer | 左上角y坐标。 | |
电动车检测
| 参数 | 类型 | 描述 | 下级对象 |
|---|
| DetectBoxes | Array of Integers | 返回检测矩形框,矩形框坐标是box=[left, top,width, height]。如有多个矩形框则返回[box0,box1]。 | |
| DetectScores | Array of Floats | 返回目标框的置信度,范围是0-1。 | |
| DetectClses | Array of Integers | 返回目标框的类别。1:电动车。 | |
人脸识别
| 参数 | 类型 | 描述 | 下级对象 |
|---|
| Id | Integer | 人员ID。 | |
| Name | String | 姓名。 | |
| Number | String | 人员编号。 | |
| MatchPicUrl | String | 返回人脸库中匹配到的人脸图片URL。 | |
| MatchFaceCropUrl | String | 返回人脸库中人脸图片的抠图URL。 | |
| MatchPicRectangles | Array of Integers | 返回人脸库中人脸的坐标box,矩形框坐标是box =[left, top,width, height]。 | |
| FaceRectangles | Array of Integers | 返回截图中人脸的坐标,矩形框坐标是box =[left, top,width, height]。 | |
| Score | Float | 返回截图人脸与人脸库中人脸的匹配度。 | |
回调消息示例
吸烟检测
{
"EventType":5,
"Expires":1545030873,
"Signature":"ca3e25e5dc17a6f9909a9ae7281e300d",
"DeviceId":"29942114322219022",
"GbId":"34082400011188226858",
"DeviceName":"***",
"AIType":5,
"EventTime":1545047000,
"ImageUrl":"https://",
"Data":{
"DetectBoxes":[
987,
312,
216,
759,
832,
278,
185,
620
],
"DetectScores":[
0.9033203125,
0.62158203125
],
"DetectClses":[
1,
1
]
}
}
安全帽反光服检测
{
"EventType":5,
"Expires":1545030873,
"Signature":"ca3e25e5dc17a6f9909a9ae7281e300d",
"DeviceId":"29942114322219022",
"GbId":"34082400011188226858",
"DeviceName":"***",
"AIType":7,
"EventTime":1545047000,
"ImageUrl":"https://",
"Data":{
"DetectBoxes":[
987,
312,
216,
759,
832,
278,
185,
620
],
"DetectScores":[
0.9033203125,
0.62158203125
],
"DetectClses":[
0,
3
]
}
}
行人检测
{
"EventType":5,
"Expires":1545030873,
"Signature":"ca3e25e5dc17a6f9909a9ae7281e300d",
"DeviceId":"29942114322219022",
"GbId":"34082400011188226858",
"DeviceName":"***",
"AIType":8,
"EventTime":1545047000,
"ImageUrl":"https://",
"Data":{
"DetectBoxes":[
987,
312,
216,
759,
832,
278,
185,
620
],
"DetectScores":[
0.9033203125,
0.62158203125
],
"DetectClses":[
0,
0
]
}
}
危险区域检测
{
"EventType":5,
"Expires":1545030873,
"Signature":"ca3e25e5dc17a6f9909a9ae7281e300d",
"DeviceId":"29942114322219022",
"GbId":"34082400011188226858",
"DeviceName":"***",
"AIType":9,
"EventTime":1545047000,
"ImageUrl":"https://",
"Data":{
"DetectBoxes":[
987,
312,
216,
759,
832,
278,
185,
620
],
"DetectScores":[
0.9033203125,
0.62158203125
],
"DetectClses":[
0,
0
]
}
}
烟雾明火检测
{
"EventType":5,
"Expires":1545030873,
"Signature":"ca3e25e5dc17a6f9909a9ae7281e300d",
"DeviceId":"29942114322219022",
"GbId":"34082400011188226858",
"DeviceName":"***",
"AIType":10,
"EventTime":1545047000,
"ImageUrl":"https://",
"Data":{
"DetectBoxes":[
987,
312,
216,
759,
832,
278,
185,
620
],
"DetectScores":[
0.9033203125,
0.62158203125
],
"DetectClses":[
0,
0
]
}
}
车牌识别
{
"EventType":5,
"Expires":1545030873,
"Signature":"ca3e25e5dc17a6f9909a9ae7281e300d",
"DeviceId":"29942114322219022",
"GbId":"34082400011188226858",
"DeviceName":"***",
"AIType":17,
"EventTime":1545047000,
"ImageUrl":"https://",
"Data":{
"Boxes":[
[
[
782,
1393
],
[
921,
1376
],
[
926,
1419
],
[
787,
1438
]
],
[
[
1706,
913
],
[
1807,
906
],
[
1810,
940
],
[
1709,
947
]
]
],
"Texts":[
"青E73***",
"青BB3***"
]
}
}
入侵检测
{
"EventType":5,
"Expires":1545030873,
"Signature":"ca3e25e5dc17a6f9909a9ae7281e300d",
"DeviceId":"29942114322219022",
"GbId":"34082400011188226858",
"DeviceName":"***",
"AIType":19,
"EventTime":1545047000,
"ImageUrl":"https://",
"Data":{
"FaceCount":1,
"FaceRectangles":[
529,
219,
43,
53
],
"MatchList":[
{
"Location":{
"X":529,
"Y":219,
"Width":43,
"Height":53
},
"FaceItems":[
{
"EntityId":"289575371019796480",
"Score":81.70854814532174,
"DbName":"289502451065044992",
"Labels":"{\"name\":\"小明\",\"cardId\":null,\"description\":null}"
},
{
"EntityId":"289601072104095744",
"Score":28.600664596359827,
"DbName":"289502451065044992",
"Labels":"{\"name\":\"小李\",\"cardId\":null,\"description\":null}"
}
]
}
]
}
}
电动车检测
{
"EventType":5,
"Expires":1545030873,
"Signature":"ca3e25e5dc17a6f9909a9ae7281e300d",
"DeviceId":"29942114322219022",
"GbId":"34082400011188226858",
"DeviceName":"***",
"AIType":23,
"EventTime":1545047000,
"ImageUrl":"https://",
"Data":{
"DetectBoxes":[
987,
312,
216,
759,
832,
278,
185,
620
],
"DetectScores":[
0.9033203125,
0.62158203125
],
"DetectClses":[
1,
1
]
}
}
人脸识别
{
"EventType": 5,
"Expires": 1545030873,
"Signature": "ca3e25e5dc17a6f9909a9ae7281e300d",
"DeviceId": "29942114322219022",
"GbId": "34082400011188226858",
"DeviceName": "***",
"AIType": 34,
"EventTime": 1545047000,
"ImageUrl": "https://",
"Data": {
"Id": 40223,
"Name": "吴",
"Number": "1234",
"MatchPicUrl": "https://",
"MatchFaceCropUr":"https://",
"MatchPicRectangles": "[766,687,1664,2327]",
"Score": 0.6068044,
"FaceRectangles": "[1188,661,119,134]"
}
}