云服务器内容精选

  • 部署算法服务 进入“我的算法服务”,单击目标算法服务“操作”列的“部署”,进入“部署算法”页面。 参考表1填写相关参数。 表1 部署算法参数说明 参数名称 参数说明 路数 本次部署预计需要支持的最大路数。后台会自动申请、创建足够多的算法资源支撑作业的运行。 资源池规格 选择本次部署所使用的资源池,部署前需要在运维中心创建资源池。 服务启动参数 本次部署传入的参数信息,不同的算法服务启动参数不同,参数的功能请咨询算法开发者。
  • 运行Webhook Service 视频接入分析的算法服务支持的输出类型为Webhook。在创建作业前您需确保Webhook Service已运行成功。 下面以一个简单的python脚本作为示例,展示如何启动Webhook Service并保存接收的数据。 准备一台本地的Linux服务器,确保Linux服务器和边缘节点服务器网络通畅,并已安装python环境。 使用ifconfig命令在Linux服务器上查询服务器IP地址。 修改示例脚本第18行,填入服务器IP地址。 图1 示例脚本 import json from wsgiref.simple_server import make_server def application(environ, start_response): start_response('200 OK', [('Content-Type', 'application/json')]) request_body = environ["wsgi.input"].read(int(environ.get("CONTENT_LENGTH", 0))) f=open('./post.txt','a') f.write(request_body) f.write("\n") f.close() return ("200 success\n") if __name__ == "__main__": port = 6006 httpd = make_server("10.10.10.1", port, application) print "serving http on port {0}...".format(str(port)) httpd.serve_forever() 脚本中的端口6006可以根据用户实际需要修改。 创建作业时,算法输出Webhook URL设置为:http://${IP}:${port}。例如:http://10.10.10.1:6006。 执行脚本,启动Webhook Service。 图2 执行脚本成功 父主题: 使用边缘入侵检测算法
  • 创建边缘资源池 登录视频接入分析服务,在运维中心页面左侧导航栏中选择“边缘资源池”。 在“边缘资源池”页面,单击“创建边缘资源池”,参考表1配置相关参数。 表1 创建边缘运行池参数说明 字段 是否必填 类型 示例 参数说明 资源池名称 是 String edge-pool-001 只能由英文字母(a~z)、数字(0~9)、中划线(-)组成, 长度范围为[4, 32]。 描述 否 String - 输入长度范围为0到255个字符。 边缘节点 是 string edge-node-001 通过下拉框进行选择,来源于IEF平台纳管的边缘节点。 配置完成后,单击“提交”。系统自动跳转至边缘资源池列表页面。可在“边缘资源池”页面查看创建的边缘资源池信息。
  • 使用流程 图1 云上算法使用流程 表1 云上算法使用流程 流程 说明 详细指导 购买算法 根据业务需求选择购买使用不同的算法包,算法包包含了若干算法,创建作业前,要先购买算法包。 购买算法包 接入IVM视频 表示直接从IVM拉取实时视频流推流地址获取视频数据。 接入IVM视频数据 开通DIS通道 云上入侵检测算法作业的输出类型设置为DIS时,在创建作业前需确保DIS通道已开通成功。 开通DIS通道 新增视频源 创建需要进行处理分析的视频源。创建作业前,要先创建视频源。 新增视频源 创建分析作业 创建入侵检测算法作业,需要设置相应的算法参数、配置输入数据的来源和输出数据的类型。 创建分析作业 查看分析结果 您可以根据设置的输出数据类型,采用对应的方式获取作业分析结果。 查看分析结果
  • 请求 请求样例1(VCN输入+WEBHOOK输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-event-action-recog-edge/tasks { "name": "event-action-recog-task", "description": "event-action-recog task test", "input": { "type": "vcn", "vcn":{ "ip":"172.100.119.6", "password":"CQeNfcRLwyMvH77AkDBaPS+BKXdFu/1bAXtIMNTx3QPbVewjipNq06nNodxWI28I1lCUsvv2+wB1joepzynLVW3g2nz0k9vaCRDoK6=", "port":"4675", "username":"testname" }, "data": [ { "index": 0, "device_id":"07211540881586160101#f7964493ff764bbf9294d58b22e63de6", "stream_type":1 } ] }, "output": { "webhook": { "url": "https://apigw.huawei.com/api/event/callback", "headers": { "content-type": "application/json" } } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "smoking_detection_sw": 1, "phoning_detection_sw": 0, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "image_compression_ratio":90 } } } 请求样例2(摄像头输入+DIS输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-event-action-recog-edge/tasks { "name": "event-action-recog-edge-task", "description": "event-action-recog-edge task test", "input": { "type": "edgecamera", "data": [ { "id": "aec5857c-222f-4aa9-be39-23654e118886", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-event-action-recog-edge" } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "smoking_detection_sw": 1, "phoning_detection_sw": 0, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "image_compression_ratio":90 } } } 请求样例3(edgerestful输入+DIS输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-event-action-recog-edge/tasks { "name": "event-action-recog-task", "description": "event-action-recog task test", "input": { "type": "edgerestful", "data": [ { "url":"https://100.127.134.69:554/test/data", "certificate_check": false, "rtsp_path_in_response": "data/url" } ] }, "output": { "dis": { "stream_name": "dis-event-action-recog-edge" } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "smoking_detection_sw": 1, "phoning_detection_sw": 0, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "image_compression_ratio":90 } } } 请求样例4(VCN输入+DIS输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-event-action-recog-edge/tasks { "name": "event-action-recog-task", "description": "event-action-recog task test", "input": { "type": "vcn", "vcn":{ "ip":"172.100.119.6", "password":"CQeNfcRLwyMvH77AkDBaPS+BKXdFu/1bAXtIMNTx3QPbVewjipNq06nNodxWI28I1lCUsvv2+wB1joepzynLVW3g2nz0k9vaCRDoK6=", "port":"4675", "username":"testname" }, "data": [ { "index": 0, "device_id":"07211540881586160101#f7964493ff764bbf9294d58b22e63de6", "stream_type":1 } ] }, "output": { "dis": { "stream_name": "dis-event-action-recog-edge" } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "smoking_detection_sw": 1, "phoning_detection_sw": 0, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "image_compression_ratio":90 } } } 参数说明 参数 是否必选 类型 说明 name 是 String 作业名称,只能由中文、字母(a~zA~Z)、数字(0~9)、中划线(-)、下划线(_)组成,长度范围为[1,100]。 description 否 String 作业描述信息,最大长度为500字符长度。 input 是 Object 视频数据输入列表,支持从指定的边缘摄像头读取数据,即输入类型为“edgecamera”,“edgerestful”,“VCN”。 详细参数定义参见task.input(任务输入参数)。 service_version 是 String 功能版本号,版本号为3.0。边缘算法版本支持的显卡硬件为T4和Davinci芯片。 resource_order_id 是 String 购买的算法能力包ID,在服务界面购买算法能力包获取。 edge_pool_id 是 String 边缘运行池ID,获取方法参见创建边缘运行池。 output 是 Object 结果数据的输出列表,目前支持以下输出类型: DIS:将结果输出到您指定的DIS通道 。 Webhook:将结果输出到Webhook URL。 Localpath:将作业的运行结果保存在边缘节点本地(节点必须为linux系统),必须为linux路径,例如“/opt/cloud/”。 详细参数定义见task.output(任务输出参数)。 service_config 否 Object 服务的算法配置,配置参数见service_config参数说明。 service_config参数说明 参数 是否必选 类型 说明 common 否 Object 作业参数配置,配置参数见common参数说明。 common参数说明 参数 是否必选 类型 说明 smoking_detection_sw 否 Int 对应控制台的界面参数“吸烟检测开关”。 对输入视频流是否检测吸烟动作,取值范围: "0":表示不检测吸烟动作。 "1":表示检测吸烟动作。 默认值为1。 phoning_detection_sw 否 Int 对应控制台的界面参数“打手机检测开关”。 对输入视频流是否检测打手机动作,取值范围: "0":表示不检测打手机动作。 "1":表示检测打手机动作。 默认值为0。 render_result_sw 否 Int 对应控制台的界面参数“目标框渲染开关”。 输出图像是否绘制告警目标边框,取值范围: "0":表示不绘制。 "1":表示用红色绘制告警目标边框。 默认值为0。 render_roi_sw 否 Int 对应控制台的界面参数“检测区域渲染开关”。 输出图像是否绘制检测区域,取值范围: "0":表示不绘制。 "1":表示用黄色绘制用户设定区域。 默认值为0。 target_roi 否 String 对应控制台的界面参数“检测区域设置”。 表示检测区域,该字段为JSON格式的字符串,API调用时需要加转义符。详细JSON格式参见target_roi(目标区域)。 例如: {"polygons":[{"data":[[84,389],[1840,349],[1824,526],[78,526]]}]} 参数没有携带时,默认区域为整个视频帧。 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 图片压缩百分比,取值范围为[20,100]。 默认值:90,表示图片压缩比为90%。
  • 请求 请求样例1(摄像头输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-non-motor-detection-edge/tasks { "name": "c-non-motor-detection-edge-task", "description": "c-non-motor-detection-edge task test", "input": { "type": "edgecamera", "data": [ { "id": "9f8933c9-448c-48e5-8bc0-631ea83b92eb", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-c-non-motor-detection-edge" }, "webhook": { "url": "https://apigw.huawei.com/api/event/callback", "headers": { "content-type":"application/json" } } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "event_disappear_alert_sw": 0, "illegal_park_detection_sw": 1, "illegal_park_alert_threshold": 30, "intrusion_detection_sw": 0, "electromobile_detect_sw": 1, "bicycle_detect_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[43,266],[42,645],[472,644],[416,212]],\"name\":\"legal_area\"},{\"data\":[[311,182],[282,670],[941,661],[835,170]],\"name\":\"prohibit_entering_area\"}]}", "render_result_sw": 1, "render_roi_sw": 1, "image_compression_ratio":90 } } } 请求样例2(edgerestful输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-non-motor-detection-edge/tasks { "name": "c-non-motor-detection-edge-task", "description": "c-non-motor-detection-edge task test", "input": { "type": "edgerestful", "data": [ { "index": 0, "url":"https://100.127.134.69:554/test/data", "certificate_check": false, "rtsp_path_in_response": "data/url" } ] }, "output": { "dis": { "stream_name": "dis-c-non-motor-detection-edge" }, "webhook": { "url": "https://apigw.huawei.com/api/event/callback", "headers": { "content-type":"application/json" } } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "event_disappear_alert_sw": 0, "illegal_park_detection_sw": 1, "illegal_park_alert_threshold": 30, "intrusion_detection_sw": 0, "electromobile_detect_sw": 1, "bicycle_detect_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[43,266],[42,645],[472,644],[416,212]],\"name\":\"legal_area\"},{\"data\":[[311,182],[282,670],[941,661],[835,170]],\"name\":\"prohibit_entering_area\"}]}", "render_result_sw": 1, "render_roi_sw": 1, "image_compression_ratio":90 } } } 请求样例3(VCN输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-non-motor-detection-edge/tasks { "name": "c-non-motor-detection-edge-task", "description": "c-non-motor-detection-edge task test", "input": { "type": "vcn", "vcn":{ "ip":"172.100.119.6", "password":"CQeNfcRLwyMvH77AkDBaPS+BKXdFu/1bAXtIMNTx3QPbVewjipNq06nNodxWI28I1lCUsvv2+wB1joepzynLVW3g2nz0k9vaCRDoK6=", "port":"4675", "username":"testname" }, "data": [ { "index": 0, "deivce_id":"07211540881586160101#f7964493ff764bbf9294d58b22e63de6", "stream_type":1 } ] }, "output": { "dis": { "stream_name": "dis-c-non-motor-detection-edge" }, "webhook": { "url": "https://apigw.huawei.com/api/event/callback", "headers": { "content-type":"application/json" } } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "event_disappear_alert_sw": 0, "illegal_park_detection_sw": 1, "illegal_park_alert_threshold": 30, "intrusion_detection_sw": 0, "electromobile_detect_sw": 1, "bicycle_detect_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[43,266],[42,645],[472,644],[416,212]],\"name\":\"legal_area\"},{\"data\":[[311,182],[282,670],[941,661],[835,170]],\"name\":\"prohibit_entering_area\"}]}", "render_result_sw": 1, "render_roi_sw": 1, "image_compression_ratio":90 } } } 参数说明 参数 是否必选 类型 说明 name 是 String 作业名称,只能由中文、字母(a~zA~Z)、数字(0~9)、中划线(-)、下划线(_)组成,长度范围为[1,100]。 description 否 String 作业描述信息,最大长度为500字符长度。 input 是 Object 视频数据输入列表,支持从指定的边缘摄像头读取数据,即输入类型为“edgecamera”,“edgerestful”,“VCN”。 详细参数定义参见task.input(任务输入参数)。 service_version 是 String 功能版本号,版本号为3.0。边缘算法版本支持的显卡硬件为T4和Davinci芯片。 resource_order_id 是 String 购买的算法能力包ID,在服务界面购买算法能力包获取。 edge_pool_id 是 String 边缘运行池ID,获取方法参见创建边缘运行池。 output 是 Object 结果数据的输出列表,目前支持以下输出类型: DIS:将结果输出到您指定的DIS通道 。 Webhook:将结果输出到Webhook URL。 Localpath:将作业的运行结果保存在边缘节点本地(节点必须为linux系统),必须为linux路径,例如“/opt/cloud/”。 详细参数定义见task.output(任务输出参数)。 service_config 否 Object 服务的算法配置,配置参数见ServiceConfig参数说明。 service_config中common参数说明 字段 是否必选 类型 说明 event_disappear_alert_sw 否 Int 对应控制台的界面参数“事件消失告警开关”。 取值范围: "0":表示不开启。 "1":表示开启。 默认值为0。 illegal_park_detection_sw 否 Int 对应控制台的界面参数“违停检测开关”。 违停检测开关,取值范围[0,1]: 0: 表示不检测违停事件。 1: 表示检测违停事件。 默认值:1。 illegal_park_alert_threshold 否 Int 对应控制台的界面参数“告警触发时间”。 告警触发时间阈值,当illegal_park_detection_sw=1时该参数生效。单位秒,取值范围[10,300]。电动车停留超过这个时间则告警。 默认值:30。 intrusion_detection_sw 否 Int 对应控制台的界面参数“入侵检测开关”。 0: 表示不检测入侵事件。 1: 表示检测入侵事件。 默认值:0。 electromobile_detect_sw 否 Int 对应控制台的界面参数“电动车检测开关”。 0: 表示不检测电动车。 1: 表示检测电动车。 默认值:1。 bicycle_detect_sw 否 Int 对应控制台的界面参数“自行车检测开关”。 0: 表示不检测自行车。 1: 表示检测自行车。 默认值:1。 target_roi 否 String 对应控制台的界面参数“区域设置”。 电动车检测区域设置,包括合法停车区域、非法停车区域、禁止进入区域。 合法停车区域,区域参数。用"name":"legal_area"标识。当电动车停在合法停车区域之外,则触发违停事件。 非法停车区域,区域参数。用"name":"illegal_area"标识。当电动车停在非法停车区域时,则触发违停事件。 禁止进入区域,区域参数。用"name":"prohibit_entering_area"标识。当有电动车入侵禁止进入区域,则触发入侵事件。 该字段为JSON格式的字符串,API调用时需要加转义符。详细JSON格式参见target_roi(目标区域)。 例如: {"polygons":[{"data":[[43,266],[42,645],[472,644],[416,212]],"name":"legal_area"},{"data":[[311,182],[282,670],[941,661],[835,170]],"name":"prohibit_entering_area"},{"data":[[1272,592],[1481,813],[1623,638],[1293,356]],"name":"illegal_area"}]} 当同时设置"legal_area"与"illegal_area"时,生效的为"illegal_area",在绘制渲染区域时,也只会渲染非法停车区域。 参数没有携带时,默认全屏都是不合法停车区域,在绘制渲染区域时,只会在左上角[0,0]-[0,0]位置绘制一个绿色的合法停车区域;全屏都是禁止进入区域。 render_result_sw 否 Int 对应控制台的界面参数“目标框渲染开关”。 输出图像是否绘制告警目标边框,取值范围: "0":表示不绘制。 "1":表示用红色绘制告警目标边框。 默认值为0。 render_roi_sw 否 Int 对应控制台的界面参数“检测区域渲染开关”。 输出图像是否绘制检测区域,取值范围: "0":表示不绘制。 "1":表示用绿色绘制用户设定的合法停车区域,用黄色绘制用户设定的禁止进入区域或者非法停车区域。 默认值为0。 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 输出图片压缩百分比,取值范围为[20,100]。 默认值:90,表示图片压缩比为90%。
  • 响应 响应样例 { "id":"8656efdafebf440bb7008f174db6c567", "name":"vehicledetection-edge-task", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":null, "service_version":"3.0", "edge_pool_id":"8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-18T03:35:03Z", "updated_at":"2020-09-18T03:35:51Z", "state":"RUNNING", "input":{ "type":"edgecamera", "data":[ { "id":"aec5857c-222f-4aa9-be39-23654e118886", "index":0 } ] }, "output": { "webhook":{ "url":"https://apigw.xx.com/api/mqs/sit", "headers":{ "content-type":"application/json" } } }, "service_config":{ "common":{ "target_roi":"{\"lines\":[{\"data\":[[50,756],[100,616]],\"properties\":{\"type\":0}},{\"data\":[[50,256],[100,116]],\"properties\":{\"type\":1}}],\"polygons\":[{\"data\":[[487,465],[1850,450],[1905,1013],[515,1050]]}]}", "license_plate":{ "local_city":"B", "local_province":"津" }, "output_image_sw":1, "render_roi_sw": 1, "image_compression_ratio":100 } } } 响应参数说明 请参考作业详情参数。
  • 响应 响应样例(VIS输入+DIS输出) { "id":"a29dfa1bfcdd4a62b3f6048fe6965e8b", "name":"fightdetect-cloud-task", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"fighting detection task test", "service_version":"3.0", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-21T12:57:12Z", "updated_at":"2020-09-21T12:57:12Z", "state":"PENDING", "input":{ "type": "vis", "data": [{ "stream_name": "fightdetect-stream", "index": 0 }] }, "output":{ "dis":{ "stream_name":"dis-fightdetect" } }, "service_config":{ "common":{ "render_result_sw":1, "image_compression_ratio":90, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[100,100],[1800,100],[1800,1000],[100,1000]]}]}" } } } 响应参数说明 请参考作业详情参数。
  • 响应 响应样例 { "id":"cb088e91e03b4e4a87d55bbaae1debe0", "name":"highway-flow-event-task", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"highwayflowevent task test", "service_version":"3.0", "edge_pool_id":"42deafda231942cd810b592b9ed933dc", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-18T12:29:53Z", "updated_at":"2020-09-18T12:29:53Z", "state":"RUNNING", "input":{ "type":"edgecamera", "data":[ { "id":"6233039b-698f-4347-8ced-ef0d14605c0b", "index":0 } ] }, "output": { "webhook":{ "url":"https://apigw.xx.com/api/mqs/sit", "headers":{ "content-type":"application/json" } } }, "service_config":{ "common":{ "target_roi": "{\"lines\":[{\"data\":[[555,337],[665,1071]],\"properties\":{\"type\":0}},{\"data\":[[760,369],[1480,1060]],\"properties\":{\"type\":1}},{\"data\":[[875,345],[1910,887]],\"properties\":{\"type\":2}},{\"data\":[[50,447],[100,489]],\"properties\":{\"type\":3,\"distance\":15,\"direction\":1}},{\"data\":[[50,597],[100,723]],\"properties\":{\"type\":3,\"distance\":12,\"direction\":0}},{\"data\":[[50,450],[100,450]],\"properties\":{\"type\":4,\"direction\":1}},{\"data\":[[50,520],[100,720]],\"properties\":{\"type\":4,\"direction\":0}}]}", "congestion_sw": 1, "flow_static_interval": 60, "abnormal_park_sw": 1, "abnormal_park_threshold": 180, "abnormal_park_output_interval": 180, "congestion_output_interval": 180, "person_detect_sw": 0, "against_regulation_drive_sw": 0, "is_light_invariant": 0, "drop_detect_sw": 0, "fog_detect_sw": 0, "construct_detect_sw": 0 } } } 响应参数说明 请参考作业详情参数。
  • 响应 响应样例 { "id":"a9c003fa9c7843118f79ee2ddd4389f1", "name":"sharedbicycledetection-edge-task", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"Sharedbicycledetection task test", "service_version":"3.0", "edge_pool_id":"b747eb49c1d44b3ebbcf0723e3d50dba", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-21T13:36:30Z", "updated_at":"2020-09-21T13:36:30Z", "state":"PENDING", "input":{ "type":"edgecamera", "data":[ { "id":"aec5857c-222f-4aa9-be39-23654e118886", "index":0 } ] }, "output":{ "dis":{ "stream_name":"dis-sharedbicycledetection-edge" }, "webhook":{ "url":"https://apigw.huawei.com/api/event/callback", "headers":{ "content-type":"application/json" } } }, "service_config":{ "common":{ "alert_mode":"single", "alert_detection_interval":60, "illegal_park_alert_threshold":30, "render_result_sw":1, "target_roi":"{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "image_compression_ratio":90 } } } 响应参数说明 请参考作业详情参数。
  • 响应 响应样例 { "id":"de6f35a7cd904830b2ca544e4613febe", "name":"event-action-recog-edge-task", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"event-action-recog-edge task test", "service_version":"3.0", "edge_pool_id":"8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-21T13:51:26Z", "updated_at":"2020-09-21T13:51:26Z", "state":"PENDING", "input":{ "type":"edgecamera", "data":[ { "id":"aec5857c-222f-4aa9-be39-23654e118886", "index":0 } ] }, "output": { "webhook":{ "url":"https://apigw.xx.com/api/mqs/sit", "headers":{ "content-type":"application/json" } } }, "service_config":{ "common":{ "smoking_detection_sw":1, "phoning_detection_sw":0, "render_result_sw":1, "render_roi_sw":1, "target_roi":"{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "image_compression_ratio":90 } } } 响应参数说明 请参考作业详情参数。
  • 响应 响应样例 { "id":"8656efdafebf440bb7008f174db6c567", "name":"fire-exit-occupation-edge", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":null, "service_version":"3.0", "edge_pool_id":"8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-18T03:35:03Z", "updated_at":"2020-09-18T03:35:51Z", "state":"RUNNING", "input":{ "type":"edgecamera", "data":[ { "id":"ec723db5-e94b-4920-935c-5d5d666ad65a", "index":0 } ] }, "output": { "webhook":{ "url":"https://apigw.xx.com/api/mqs/sit", "headers":{ "content-type":"application/json" } } }, "service_config":{ "common":{ "event_disappear_alert_sw": 0, "image_compression_ratio":90, "render_roi_sw":1, "render_result_sw":1, "stacking_occupation_sw":1, "vehicle_occupation_sw":1, "stacking_residence_time":40, "vehicle_residence_time":50, "target_roi":"{\"polygons\":[{\"data\":[[0, 0], [0, 1000], [1920, 1000], [1920, 0]]}]}" } } } 响应参数说明 请参考作业详情参数。
  • 请求 请求样例1(VCN输入+WEBHOOK输出) POST /v1/6204a5bd270343b5885144cf9c8c158d/services/c-pose-action-recog-edge/tasks { "name": "pose-action-recog-edge-task", "description": "pose-action-recog-edge task test", "input": { "type": "vcn", "vcn":{ "ip":"172.100.119.6", "password":"CQeNfcRLwyMvH77AkDBaPS+BKXdFu/1bAXtIMNTx3QPbVewjipNq06nNodxWI28I1lCUsvv2+wB1joepzynLVW3g2nz0k9vaCRDoK6=", "port":"4675", "username":"testname" }, "data": [ { "index": 0, "device_id":"07211540881586160101#f7964493ff764bbf9294d58b22e63de6", "stream_type":1 } ] }, "output": { "webhook":{ "url":"https://apigw.xx.com/api/mqs/sit", "headers":{ "content-type":"application/json" } } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "climb_detection_sw": 1, "fall_detection_sw": 0, "wave_detection_sw": 0, "bend_detection_sw": 0, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[0,0],[0,1080],[1920,1080],[1920,0]]}]}", "image_compression_ratio":90 } } } 请求样例2(摄像头输入+DIS输出) POST /v1/6204a5bd270343b5885144cf9c8c158d/services/c-pose-action-recog-edge/tasks { "name": "pose-action-recog-edge-task", "description": "pose-action-recog-edge task test", "input": { "type": "edgecamera", "data": [ { "id": "aec5857c-222f-4aa9-be39-23654e118886", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-pose-action-recog-edge" } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "climb_detection_sw": 1, "fall_detection_sw": 0, "wave_detection_sw": 0, "bend_detection_sw": 0, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[0,0],[0,1080],[1920,1080],[1920,0]]}]}", "image_compression_ratio":90 } } } 请求样例3(edgerestful输入+DIS输出) POST /v1/6204a5bd270343b5885144cf9c8c158d/services/c-pose-action-recog-edge/tasks { "name": "pose-action-recog-edge-task", "description": "pose-action-recog-edge task test", "input": { "type": "edgerestful", "data": [ { "index": 0, "url":"https://100.127.134.69:554/test/data", "certificate_check": false, "rtsp_path_in_response": "data/url" } ] }, "output": { "dis": { "stream_name": "dis-pose-action-recog-edge" } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "climb_detection_sw": 1, "fall_detection_sw": 0, "wave_detection_sw": 0, "bend_detection_sw": 0, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[0,0],[0,1080],[1920,1080],[1920,0]]}]}", "image_compression_ratio":90 } } } 请求样例4(VCN输入+DIS输出) POST /v1/6204a5bd270343b5885144cf9c8c158d/services/c-pose-action-recog-edge/tasks { "name": "pose-action-recog-edge-task", "description": "pose-action-recog-edge task test", "input": { "type": "vcn", "vcn":{ "ip":"172.100.119.6", "password":"CQeNfcRLwyMvH77AkDBaPS+BKXdFu/1bAXtIMNTx3QPbVewjipNq06nNodxWI28I1lCUsvv2+wB1joepzynLVW3g2nz0k9vaCRDoK6=", "port":"4675", "username":"testname" }, "data": [ { "index": 0, "device_id":"07211540881586160101#f7964493ff764bbf9294d58b22e63de6", "stream_type":1 } ] }, "output": { "dis": { "stream_name": "dis-pose-action-recog-edge" } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "climb_detection_sw": 1, "fall_detection_sw": 0, "wave_detection_sw": 0, "bend_detection_sw": 0, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[0,0],[0,1080],[1920,1080],[1920,0]]}]}", "image_compression_ratio":90 } } } 参数说明 参数 是否必选 类型 说明 name 是 String 作业名称,只能由中文、字母(a~zA~Z)、数字(0~9)、中划线(-)、下划线(_)组成,长度范围为[1,100]。 description 否 String 作业描述信息,最大长度为500字符长度。 input 是 Object 视频数据输入列表,支持从指定的边缘摄像头读取数据,即输入类型为“edgecamera”,“edgerestful”,“VCN”。 详细参数定义参见task.input(任务输入参数)。 service_version 是 String 功能版本号,版本号为3.0。边缘算法版本支持的显卡硬件为T4和Davinci芯片。 resource_order_id 是 String 算法能力包ID。 edge_pool_id 是 String 边缘运行池ID,获取方法参见创建边缘运行池。 output 是 Object 结果数据的输出列表,目前支持以下输出类型: DIS:将结果输出到您指定的DIS通道 。 Webhook:将结果输出到Webhook URL。 Localpath:将作业的运行结果保存在边缘节点本地(节点必须为linux系统),必须为linux路径,例如“/opt/cloud/”。 详细参数定义见task.output(任务输出参数)。 service_config 否 Object 服务的算法配置,配置参数见service_config参数说明。 service_config参数说明 参数 是否必选 类型 说明 common 否 Object 作业参数配置,配置参数见common参数说明。 common参数说明 参数 是否必选 类型 说明 climb_detection_sw 否 Int 对应控制台的界面参数“翻越检测开关”。 对输入视频流是否检测翻越动作,取值范围: "0":表示不检测。 "1":表示检测。 默认值为1。 fall_detection_sw 否 Int 对应控制台的界面参数“摔倒检测开关”。 对输入视频流是否检测摔倒动作,取值范围: "0":表示不检测。 "1":表示检测。 默认值为0。 wave_detection_sw 否 Int 对应控制台的界面参数“挥手检测开关”。 对输入视频流是否检测挥手动作,取值范围: "0":表示不检测。 "1":表示检测。 默认值为0。 bend_detection_sw 否 Int 对应控制台的界面参数“弯腰检测开关”。 对输入视频流是否检测弯腰动作,取值范围: "0":表示不检测。 "1":表示检测。 默认值为0。 render_result_sw 否 Int 对应控制台的界面参数“目标框渲染开关”。 输出图像是否绘制告警目标边框,取值范围: "0":表示不绘制。 "1":表示用红色绘制告警目标边框。 默认值为0。 render_roi_sw 否 Int 对应控制台的界面参数“检测区域渲染开关”。 输出图像是否绘制检测区域,取值范围: "0":表示不绘制。 "1":表示用黄色绘制用户设定区域。 默认值为0。 target_roi 否 String 对应控制台的界面参数“检测区域设置”。 表示检测区域,该字段为JSON格式的字符串,API调用时需要加转义符。详细JSON格式参见target_roi(目标区域)。 例如:{"lines":[{"data":[[1,279],[908,44]]},{"data":[[50,460],[1180,74]]}],"polygons":[{"data":[[0,0],[0,720],[1280,720],[1280,0]]}]} 参数没有携带时,默认区域为整个视频帧。 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 取值范围[20,100],默认值:90,表示图片压缩比90%。
  • 请求 请求样例1(摄像头输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-safetysuitedetection-edge/tasks { "name": "safetysuitedetection-edge-task", "description": "Safetysuitedetection task test", "input": { "type": "edgecamera", "data": [ { "id": "aec5857c-222f-4aa9-be39-23654e118886", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-safetysuitedetection-edge" }, "webhook": { "url": "https://apigw.huawei.com/api/event/callback", "headers": { "content-type": "application/json" } } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "hat_detection_sw": 0, "cloth_detection_sw": 1, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "image_compression_ratio":90 } } } 请求样例2(edgerestful输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-safetysuitedetection-edge/tasks { "name": "safetysuitedetection-edge-task", "description": "Safetysuitedetection task test", "input": { "type": "edgerestful", "data": [ { "index": 0, "url":"https://100.127.134.69:554/test/data", "certificate_check": false, "rtsp_path_in_response": "data/url" } ] }, "output": { "dis": { "stream_name": "dis-safetysuitedetection-edge" }, "webhook": { "url": "https://apigw.huawei.com/api/event/callback", "headers": { "content-type": "application/json" } } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "hat_detection_sw": 0, "cloth_detection_sw": 1, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "image_compression_ratio":90 } } } 请求样例3(VCN输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-safetysuitedetection-edge/tasks { "name": "safetysuitedetection-edge-task", "description": "Safetysuitedetection task test", "input": { "type": "vcn", "vcn":{ "ip":"172.100.119.6", "password":"CQeNfcRLwyMvH77AkDBaPS+BKXdFu/1bAXtIMNTx3QPbVewjipNq06nNodxWI28I1lCUsvv2+wB1joepzynLVW3g2nz0k9vaCRDoK6=", "port":"4675", "username":"testname" }, "data": [ { "index": 0, "device_id":"07211540881586160101#f7964493ff764bbf9294d58b22e63de6", "stream_type": 1 } ] }, "output": { "dis": { "stream_name": "dis-safetysuitedetection-edge" }, "webhook": { "url": "https://apigw.huawei.com/api/event/callback", "headers": { "content-type": "application/json" } } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "hat_detection_sw": 0, "cloth_detection_sw": 1, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "image_compression_ratio":90 } } } 参数说明 参数 是否必选 类型 说明 name 是 String 作业名称,只能由中文、字母(a~zA~Z)、数字(0~9)、中划线(-)、下划线(_)组成,长度范围为[1,100]。 description 否 String 作业描述信息,最大长度为500字符长度。 input 是 Object 视频数据输入列表,支持从指定的边缘摄像头读取数据,即输入类型为“edgecamera”,“edgerestful”,“VCN”。 详细参数定义参见task.input(任务输入参数)。 service_version 是 String 功能版本号,版本号为3.0。边缘算法版本支持的显卡硬件为T4和Davinci芯片。 resource_order_id 是 String 购买的算法能力包ID,在服务界面购买算法能力包获取。 edge_pool_id 是 String 边缘运行池ID,获取方法参见创建边缘运行池。 output 是 Object 结果数据的输出列表,目前支持以下输出类型: DIS:将结果输出到您指定的DIS通道 。 Webhook:将结果输出到Webhook URL。 Localpath:将作业的运行结果保存在边缘节点本地(节点必须为linux系统),必须为linux路径,例如“/opt/cloud/”。 详细参数定义见task.output(任务输出参数)。 service_config 否 Object 服务的算法配置,配置参数见service_config参数说明。 service_config中common参数说明 字段 是否必选 类型 说明 hat_detection_sw 否 Int 对应控制台的界面参数“工帽检测开关”。 检测工帽开关: 0:表示不检测。 1:表示检测。 默认值为1。 cloth_detection_sw 否 Int 对应控制台的界面参数“工服检测开关”。 检测工服开关: 0:表示不检测。 1:表示检测。 默认值为1。 render_result_sw 否 Int 对应控制台的界面参数“目标框渲染开关”。 输出图像是否绘制告警目标边框,取值范围: "0":表示不绘制; "1":表示用红色绘制告警目标边框。 默认值为0。 render_roi_sw 否 Int 对应控制台的界面参数“检测区域渲染开关”。 输出图像是否绘制检测区域,取值范围: "0":表示不绘制。 "1":表示用黄色绘制用户设定区域。 默认值为0。 target_roi 否 String 对应控制台的界面参数“检测区域设置”。 表示检测区域,该字段为JSON格式的字符串,API调用时需要加转义符。详细JSON格式参见target_roi(目标区域)。 例如: {"polygons":[{"data":[[84,389],[1840,349],[1824,526],[78,526]]}]} 参数没有携带时,默认区域为整个视频帧。 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 图片压缩百分比,取值范围为[20,100]。 默认值:90,表示图片压缩比为90%。
  • 响应 响应样例(VIS输入+DIS输出) { "id":"5a127c7844674d2382b7daae07794152", "name":"event-action-recog-cloud-task", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"event-action-recog task test", "service_version":"3.0", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-22T08:08:39Z", "updated_at":"2020-09-22T08:08:39Z", "state":"PENDING", "input":{ "type":"vis", "data":[ { "stream_name":"event-action-recog-cloud-video", "index":0 } ] }, "output":{ "dis":{ "stream_name":"dis-event-action-recog-cloud" } }, "service_config":{ "common":{ "smoking_detection_sw":1, "phoning_detection_sw":0, "render_result_sw":1, "render_roi_sw":1, "target_roi":"{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "image_compression_ratio":90 } } } 响应参数说明 请参考作业详情参数。