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 警戒框取反
dressType array N - 需要和人体匹配的标签(人脸、人头、帽子和衣服等)
+label string Y - 需要匹配部位的标签名
+typeName string Y - 匹配标签的别名,相同类型可设置成相同别名
+matchCenter string Y - 该标签在人体框的位置
+objThreshold float Y - 该标签物体的阈值
+bodyMatchThreshold float Y - 该标签物体框和人体框的重合度
clothesType array Y - 需要侦测穿戴类型
headType array N - 针对帽子类别的辅助判断:头部标签
faceType array N - 针对口罩类别的辅助判断:人脸标签
judgeClothesTimes int N 10 该数值×2为多帧判断的帧数
alarmType string N SafetyBelt 报警类型
judgeHead bool N true 判断是否有头标签
oneByOne bool N true 单独报警
judgeValidPercent float N 0.2 帧确认比例

响应字段

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

示例

请求

{
  "cameraId": "10000000000",
  "url": "rtsp://192.168.0.100/camera",
  "imageOut": "base64",
  "inputType": "RTSP",
  "decodeType": "nvidia",
  "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": "WithoutSafetyBelt",
        "value": {
          "interval": 0.5,
          "minTarry": 3,
          "alarmInterval": 5,
          "threshold": 0.4,
          "areaIsReverse": false,
          "minBox": {
              "width": 50,
              "height": 50
          },
          "areaBoxes": [
            [
              {"x": 100, "y": 100},
              {"x": 900, "y": 100},
              {"x": 900, "y": 800},
              {"x": 100, "y": 800}
            ]
          ],
          "dressType":[
           {
                        "label": "10",
                        "typeName": "10",
                        "matchCenter":"up_center",
                        "objThreshold": 0.4,
                        "bodyMatchThreshold":0.8
                    }, 
                    {
                        "label": "head",
                        "typeName": "head",
                        "matchCenter":"up_center",
                        "objThreshold": 0.4,
                        "bodyMatchThreshold":0.8
                    },
                    {
                        "label": "red_hard_hat",
                        "typeName": "head",
                        "matchCenter":"up_center",
                        "objThreshold": 0.4,
                        "bodyMatchThreshold":0.6
                    },
                    {
                        "label": "blue_hard_hat",
                        "typeName": "head",
                        "matchCenter":"up_center",
                        "objThreshold": 0.4,
                        "bodyMatchThreshold":0.6
                    },
                    {
                        "label": "white_hard_hat",
                        "typeName": "head",
                        "matchCenter":"up_center",
                        "objThreshold": 0.4,
                        "bodyMatchThreshold":0.6
                    },
                    {
                        "label": "yellow_hard_hat",
                        "typeName": "head",
                        "matchCenter":"up_center",
                        "objThreshold": 0.4,
                        "bodyMatchThreshold":0.6
                    },
                    {
                        "label": "green_hard_hat",
                        "typeName": "head",
                        "matchCenter":"up_center",
                        "objThreshold": 0.4,
                        "bodyMatchThreshold":0.6
                    },
                    {
                        "label": "black_hard_hat",
                        "typeName": "head",
                        "matchCenter":"up_center",
                        "objThreshold": 0.4,
                        "bodyMatchThreshold":0.6
                    },
                    {
                        "label": "orange_hard_hat",
                        "typeName": "head",
                        "matchCenter":"up_center",
                        "objThreshold": 0.4,
                        "bodyMatchThreshold":0.6
                    },
                    {
                        "label": "camouflage_hard_hat",
                        "typeName": "head",
                        "matchCenter":"up_center",
                        "objThreshold": 0.4,
                        "bodyMatchThreshold":0.6
                    },
                    {
                        "label": "Safety_belt",
                        "typeName": "Safety_belt",
                        "matchCenter":"center",
                        "objThreshold": 0.4,
                        "bodyMatchThreshold":0.01
                    }
          ],
          "clothesType": [ "head","Safety_belt"],
          "headType": ["head"]
          "faceType": 10,
          "judgeClothesTimes":5,
          "judgeHead":true,
          "oneByOne":true,
          "judgeValidPercent":0.2
        }
     }
   ]
}

响应

{
  "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": "WithoutSafetyBelt",
  "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 //置信度
      }
    ]
  }
}