Skip to content

穿戴检测

请求格式

URL /dynamic/api/v1/setup
Method POST

请求头说明

Key Value
Content-Type application/json

参数说明

Key Require Type Description
cameraId Y string 相机ID
url Y string 相机或视频地址
imageOut Y string base64-返回Base64 path-返回URL
notifyUrl Y string AI分析结果上报地址
inputType Y string RTSP-像机/File-文件
decodeType N string 解码类型, 支持cpu、device两种
skipFrame Y float 抽帧率,60秒一帧,1以下代表1秒多少,比如0.15,表示1秒15帧,0.25表示1秒25帧, 暂时不考虑
roi Y arr ROI, 暂时不考虑
areaBoxes Y arr 区域框列表, 暂时不考虑, 传默认值 []即可
fileStore N object 告警凭证视频存储服务
+url Y string 文件上传地址
+type Y int 文件服务器类型 1-GoFastDFS
+nsKey N string 存储空间KEY
+nsValue N string 存储空间VALUE
abilities Y arr AI能力列表, 参考下面能力参数

abilites参数说明

参数 类型 是否必传 默认值 描述
interval float Y 0.5 跳帧间隔,单位秒
minTarry float Y 3 停留时长,单位秒
alarmInterval float Y 5 告警上报间隔,单位秒
minBox object N - 最小目标尺寸
+width int N 50 宽, 单位像素
+height int N 50 高, 单位像素
areaBoxes array Y - 警戒框列表
+x float Y - X坐标
+y float Y - Y坐标
threshold float N 0.4 阈值
areaIsReverse boolean N false 警戒框取反
pointType int N 1 1-绝对坐标 2-相对坐标
zoomFactor float N 1.0 场景图缩放因子
dressType array N - 需要和人体匹配的标签(人脸、人头、帽子和衣服等)
+label string Y - 需要匹配部位的标签名
+typeName string Y - 匹配标签的别名,相同类型可设置成相同别名
+matchCenter string Y - 该标签在人体框的位置
+objThreshold float Y - 该标签物体的阈值
+bodyMatchThreshold float Y - 该标签物体框和人体框的重合度
clothesType array Y - 需要侦测穿戴类型
headType array Y - 针对帽子类别的辅助判断:头部标签
filterConditions array Y - 辅助判断条件
+objects array Y - 与clothesType保持一致
+condition array Y - 与headType保持一致
faceType array N - 针对口罩类别的辅助判断:人脸标签
judgeClothesTimes int N 5 该数值×2为多帧判断的帧数
judgeValidPercent float N 0.2 该数值×judgeClothesTimes为多帧判断满足条件的帧数
clothesMatchType array N - 成对匹配的服饰标签

响应字段

参数 类型 是否必传 描述
status int Y 响应状态码
message string Y 提示消息

示例

请求

示例一:实际应用传参参考,推荐使用

{
  "cameraId": "10000000000",
  "url": "rtsp://192.168.0.100/camera",
  "imageOut": "base64",
  "inputType": "RTSP",
  "decodeType": "device",
  "notifyUrl": "http://10.10.1.124:6200/api/v1/receive",
  "skipFrame": 25,
  "roi": [],
  "fileStore": {
    "url": "http://xxx.xxx.xxx.xxx:0000",
    "type": 1,
    "nsKey": "scene",
    "nsValue": "certificate"
  },
  "abilities":[
     {
        "name": "KitchenPersonWG",
        "value": {
          "interval": 0.5,
          "minTarry": 3,
          "alarmInterval": 5,
          "threshold": 0.4,
          "areaIsReverse": false,
          "pointType": 1,
          "zoomFactor": 1.0,
          "minBox": {
              "width": 50,
              "height": 50
          },
          "areaBoxes": [
            [
              {"x": 100, "y": 100},
              {"x": 900, "y": 100},
              {"x": 900, "y": 800},
              {"x": 100, "y": 800}
            ]
          ]
        }
     }
   ]
}

示例二:包含非必填参数,配置文件已配置,不推荐此使用方法。

{
  "cameraId": "10000000000",
  "url": "rtsp://192.168.0.100/camera",
  "imageOut": "base64",
  "inputType": "RTSP",
  "decodeType": "device",
  "notifyUrl": "http://10.10.1.124:6200/api/v1/receive",
  "skipFrame": 25,
  "roi": [],
  "fileStore": {
    "url": "http://xxx.xxx.xxx.xxx:0000",
    "type": 1,
    "nsKey": "scene",
    "nsValue": "certificate"
  },
  "abilities":[
     {
        "name": "KitchenPersonWG",
        "value": {
          "interval": 0.5,
          "minTarry": 3,
          "alarmInterval": 5,
          "threshold": 0.4,
          "areaIsReverse": false,
          "pointType": 1,
          "zoomFactor": 1.0,
          "minBox": {
              "width": 50,
              "height": 50
          },
          "areaBoxes": [
            [
              {"x": 100, "y": 100},
              {"x": 900, "y": 100},
              {"x": 900, "y": 800},
              {"x": 100, "y": 800}
            ]
          ],
          "dressType":[
            {
                "label": "face",
                "typeName": "face",
                "matchCenter":"up_center",
                "objThreshold": 0.4,
                "bodyMatchThreshold":0.8
            }, 
            {
                "label": "head",
                "typeName": "head",
                "matchCenter":"up_center",
                "objThreshold": 0.4,
                "bodyMatchThreshold":0.8
            },
            {
                "label": "chef_hat_white",
                "typeName": "hat",
                "matchCenter":"up_center",
                "objThreshold": 0.4,
                "bodyMatchThreshold":0.1
            },
            {
                "label": "chef_hat_red",
                "typeName": "hat",
                "matchCenter":"up_center",
                "objThreshold": 0.4,
                "bodyMatchThreshold":0.1
            },
            {
                "label": "chef_hat_black",
                "typeName": "hat",
                "matchCenter":"up_center",
                "objThreshold": 0.4,
                "bodyMatchThreshold":0.1
            }
          ],
          "clothesType":["hard_hat"],
          "headType": ["head"],
          "filterConditions":[{"objects": ["hard_hat"],"condition": ["head"]}],
          "clothesMatchType": [],
        }
     }
   ]
}

响应

{
  "status":200,
  "message"":"success"
}

报警格式

参数说明

Key Require Type Description
cameraId Y string 相机ID
alarmType Y string 告警类型
scene Y string 场景图
ts Y string 时间戳13位
boxes Y object[] 检测框数组
areas Y array 警戒框
extra Y object 扩展信息
+itemsInBox Y object[] 针对检测框的扩展
++confidence Y float 置信度

示例

{
  "cameraId": "10000000000",
  "alarmType": "KitchenPersonWG",
  "scene": "场景图, URL(或BASE64)",
  "ts": "时间戳, 13位",
  "boxes": [
    {
      "x": 340,
      "y": 200,
      "width": 200,
      "height": 240
    }
  ],
  "areas": [
    [
      {"x": 100, "y": 100},
      {"x": 900, "y": 100},
      {"x": 900, "y": 800},
      {"x": 100, "y": 800}
    ]
  ],
  "extra": {
    "itemsInBox": [
      {
        "confidence" : 0.85 //置信度
      }
    ]
  }
}

能力列表

中文名 英文名
厨师工作服(厨师帽/厨师服) KitchenPersonWG