华为云用户手册

  • 响应 响应样例 { "id":"d86edc86e1c44acbae3901b8473185f7", "name":"abandon-edge_0", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"abandon-edge", "service_version":"3.0", "edge_pool_id":"a3c7e2aec01d406a8a7f6177199d8a8d", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-19T02:54:39Z", "updated_at":"2020-09-19T02:54:39Z", "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":{ "detection_min_size":50, "alert_time_threshold":10, "alert_detection_interval":5, "image_compression_ratio":80, "render_result_sw":1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "render_roi_sw":1 } } } 响应参数说明 请参考作业详情参数。
  • 响应 响应样例 { "id":"d1cde51e12eb47aaaafa36c2b4584b5c", "name":"c-crowdcount-edge_0", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"c-crowdcount-edge", "service_version":"3.0", "edge_pool_id":"626402fe7eb8446dbf23b35412877d76", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-19T03:39:22Z", "updated_at":"2020-09-19T03:39:22Z", "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":{ "banner_detection_sw":1, "banner_threshold":"2", "alarm_threshold":"5", "sampling_time_interval":8, "density_sw":1, "visualization_output_sw":1, "target_roi": "{\"polygons\":[{\"data\":[[100,100],[1800,100],[1800,1000],[100,1000]]}]}", "image_compression_ratio":80 } } } 响应参数说明 请参考作业详情参数。
  • 请求 请求样例(摄像头输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-crowdcount-edge/tasks { "name": "crowdcount-edge-task", "description": "Crowdcounttedetection task test", "input": { "type": "edgecamera", "data": [ { "id": "aec5857c-222f-4aa9-be39-23654e118886", "index": 0 } ] }, "output": { "dis": { "stream_name": "crowdcount-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": { "banner_detection_sw": 1, "banner_threshold": "2", "alarm_threshold": "5", "sampling_time_interval": 8, "density_sw": 1, "visualization_output_sw": 1, "image_compression_ratio": 80, "target_roi": "{\"polygons\":[{\"data\":[[100,100],[1800,100],[1800,1000],[100,1000]]}]}" } } } 请求样例2(edgerestful输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-crowdcount-edge/tasks { "name": "crowdcount-edge-task", "description": "Crowdcounttedetection 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": "crowdcount-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": { "banner_detection_sw": 1, "banner_threshold": "2", "alarm_threshold": "5", "sampling_time_interval": 8, "density_sw": 1, "visualization_output_sw": 1, "image_compression_ratio": 80, "target_roi": "{\"polygons\":[{\"data\":[[100,100],[1800,100],[1800,1000],[100,1000]]}]}" } } } 请求样例3(VCN输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-crowdcount-edge/tasks { "name": "crowdcount-edge-task", "description": "Crowdcounttedetection task test", "input": { "type": "vcn", "vcn":{ "ip":"172.100.119.6", "password":"CQeNfcRLwyMvH77AkDBaPS+BKXdFu/1bAXtIMNTx3QPbVewjipNq06nNodxWI28I1lCUsvv2+wB1joepzynLVW3g2nz0k9vaCRDoK6=", "port":"4675", "username":"testname" }, "data": [ { "index": 0, "stream_type": 1, "device_id":"07211540881586160101#f7964493ff764bbf9294d58b22e63de6" } ] }, "output": { "dis": { "stream_name": "crowdcount-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": { "banner_detection_sw": 1, "banner_threshold": "2", "alarm_threshold": "5", "sampling_time_interval": 8, "visualization_output_sw": 1, "density_sw": 1, "image_compression_ratio": 80, "target_roi": "{\"polygons\":[{\"data\":[[100,100],[1800,100],[1800,1000],[100,1000]]}]}" } } } 参数说明 参数 是否必选 类型 说明 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参数说明 字段 是否必选 类型 说明 alarm_threshold 否 String 人数告警阈值列表,默认值:50人,取值范围为正整数。当视频帧中出现大于等于该阈值的人数时,通过JSON输出告警图片。该字段的输入情况如下:可以针对每个ROI区域输入不同的告警阈值,每个输入用空格进行分隔。 若用户输入的人数告警阈值列表多于实际的ROI个数,则取前边的人数。 如果输入的人数告警阈值列表少于实际的ROI个数,则比ROI个数少的部分用默认值补齐。 举例:ROI有3个,当输入25 30 20,只要有其中一个ROI告警,则发送图片。当输入25 15时,则第三个ROI会用默认值50补齐,也即变成25 15 50。当输入25 36 23 40时,算法自动选择前3个,也即25 36 23。 sampling_time_interval 否 Int 视频采样处理时间间隔,默认值:10s,取值范围[1, 30],单位秒。默认10秒采样一次视频画面,两次处理将会间隔N帧画面。 N的计算方式:sampling_time_interval * 视频fps。例如:视频fps=25,采样时间1秒,则两次处理之间会跳过25帧画面。 alert_mode 否 String 告警模式。默认值:"single"。共有两种告警模式: "single": 表示事件告警模式,只有出现满足人数告警阈值的新的告警事件时,才会上报告警信息。 "periodic": 表示周期告警模式,每当经过一个视频采样处理时间间隔,就会上报告警信息。 banner_detection_sw 否 Int 横幅检测开关,默认值0,取值范围[0,1]。当打开横幅检测开关时,会对视频画面中的ROI区域进行横幅检测。 banner_threshold 否 String 横幅告警阈值列表,默认值1,取值范围为正整数。该参数的用法可以参考alarm_threshold字段。 visualization_output_sw 否 Int 可视化输出开关,默认是0,取值范围[0 1]。默认每个ROI区域检测到的人数大于告警阈值时,只会发送原图信息。只有打开可视化开关后,才会将检测到的行人和横幅进行可视化输出。可视化场景如下: 检测到单个行人,会用红色框进行标注。 检测到游行示威的横幅,会用红色框标注。 如果检测到密集人群,会对该区域进行颜色渲染。 每个ROI框会用黄色多边形在画面中标注。 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 图片压缩百分比,取值范围为[20,100]。 默认值:90,表示图片压缩比为90% density_sw 否 Int 密度估计开关。用户可自定义是否启用密度估计模型来评估人数统计结果。推荐当人数较多、告警人数阈值较大的场景启用密度估计模型;当人数较少、告警人数阈值较低的场景可不用密度估计模型。 默认启用密度估计模型,取值为1,取值范围是[0, 1] target_roi 否 String 对应控制台的界面参数“检测区域设置”。 表示检测区域,该字段为JSON格式的字符串,API调用时需要加转义符。详细JSON格式参见target_roi(目标区域)。 例如: {"polygons":[{"data":[[84,389],[1840,349],[1824,526],[78,526]]}]} 参数没有携带时,默认区域为整个视频帧。
  • 请求 请求样例1(摄像头输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-fire-exit-occupation-edge/tasks { "name": "fire-exit-occupation-edge_task", "description": "fire-exit-occupation-edge_task", "input": { "type": "edgecamera", "data": [ { "id": "9f8933c9-448c-48e5-8bc0-631ea83b92eb", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-fire-exit-occupation" }, "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, "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]]}]}" } } } 请求样例2(edgerestful输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-fire-exit-occupation-edge/tasks { "name": "fire-exit-occupation-edge_task", "description": "fire-exit-occupation-edge_task", "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-fire-exit-occupation" }, "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, "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]]}]}" } } } 请求样例3(VCN输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-fire-exit-occupation-edge/tasks { "name": "fire-exit-occupation-edge_task", "description": "fire-exit-occupation-edge_task", "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-fire-exit-occupation" }, "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, "image_compression_ratio": 90, "render_roi_sw": 1, "render_result_sw": 1, "stacking_occupation_sw": 1, "vehicle_occupation_sw": 0, "stacking_residence_time": 40, "vehicle_residence_time": 50, "target_roi": "{\"polygons\":[{\"data\":[[0, 0], [0, 1000], [1920, 1000], [1920, 0]]}]}" } } } 参数说明 参数 是否必选 类型 说明 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参数说明 字段 是否必选 类型 说明 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 图片压缩百分比,取值范围为[20,100]。 默认值:90,表示图片压缩比为90%。 render_result_sw 否 Int 对应控制台的界面参数“目标框渲染开关”。 输出图像是否绘制告警目标边框,取值范围: "0":表示不绘制。 "1":表示用红色绘制告警目标边框。 默认值为0。 render_roi_sw 否 Int 对应控制台的界面参数“检测区域渲染开关”。 输出图像是否绘制检测区域,取值范围: "0":表示不绘制。 "1":表示用黄色绘制用户设定区域。 默认值为0。 stacking_occupation_sw 否 Int 对应控制台的界面参数“堆物占道检测开关”。 取值范围: "0":表示不开启。 "1":表示开启。 默认值为1。 vehicle_occupation_sw 否 Int 对应控制台的界面参数“车辆占道检测开关”。 取值范围: "0":表示不开启。 "1":表示开启。 默认值为1。 event_disappear_alert_sw 否 Int 对应控制台的界面参数“事件消失告警开关”。 取值范围: "0":表示不开启。 "1":表示开启。 默认值为0。 stacking_residence_time 否 Int 对应控制台的界面参数“堆物占道停留时间设置”。堆物在无明显遮挡的情况下停留时间超过该设置值则上报告警,其设置取值范围为[10, 3600],默认值为40,单位秒。 vehicle_residence_time 否 Int 对应控制台的界面参数“车辆占道停留时间设置”。车辆在无明显遮挡的情况下停留时间超过该设置值则上报告警,其设置取值范围为[10, 3600],默认值为50,单位秒。 target_roi 否 String 对应控制台的界面参数“检测区域设置”。 表示检测区域,该字段为JSON格式的字符串,API调用时需要加转义符。详细JSON格式参见target_roi(目标区域)。 例如: {"polygons":[{"data":[[84,389],[1840,349],[1824,526],[78,526]],"name":"polygon"}]} 可为每个区域设置名称,后续输出结果时会连带输出区域名称。 参数没有携带时,默认区域为整个视频帧,默认区域名称为空字符串。
  • 响应 响应样例(VIS输入+DIS输出) { "id":"2f268b9472a544e991eae3c5c3534f5b", "name":"fire-exit-occupation-cloud-task", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"fire-exit-occupation 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":"fire-exit-occupation-stream", "index":0 } ] }, "output":{ "dis":{ "stream_name":"dis-fire-exit-occupation" } }, "service_config":{ "common":{ "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]]}]}" } } } 响应参数说明 请参考作业详情参数。
  • 响应 响应样例(VIS输入+DIS输出) { "id":"3d7c81cf35784d88a4e26066bcc5debd", "name":"crowdcount-cloud-task", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":null, "service_version":"3.0", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-22T07:37:03Z", "updated_at":"2020-09-22T07:37:03Z", "state":"RUNNING", "input":{ "type":"vis", "data":[ { "stream_name":"vis-vias", "index":0 } ] }, "output":{ "dis":{ "stream_name":"dis-vias" } }, "service_config":{ "common":{ "banner_detection_sw":1, "banner_threshold":"2", "alarm_threshold":"5", "sampling_time_interval":8, "density_sw":1, "visualization_output_sw":1, "image_compression_ratio":80, "target_roi":"{\"polygons\":[{\"data\":[[100,100],[1800,100],[1800,1000],[100,1000]]}]}" } } } 响应参数说明 请参考作业详情参数。
  • 请求 请求样例1(摄像头输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-abandon-detection-edge/tasks { "name": "abandon-detection-edge-task", "description": "Abandon Detection task test", "input": { "type": "edgecamera", "data": [ { "id": "aec5857c-222f-4aa9-be39-23654e118886", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-abandondetection-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": { "detection_min_size": 50, "alert_time_threshold": 10, "alert_detection_interval": 5, "image_compression_ratio": 80, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "render_result_sw": 1, "render_roi_sw": 1 } } } 请求样例2(edgerestful输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-abandon-detection-edge/tasks { "name": "abandon-detection-edge-task", "description": "Abandon Detection 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-abandondetection-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": { "detection_min_size": 50, "alert_time_threshold": 10, "alert_detection_interval": 5, "image_compression_ratio": 80, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "render_result_sw": 1, "render_roi_sw": 1 } } } 请求样例3(VCN输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-abandon-detection-edge/tasks { "name": "abandon-detection-edge-task", "description": "Abandon Detection task test", "input": { "type": "vcn", "vcn": { "ip":"172.100.119.6", "password":"CQeNfcRLwyMvH77AkDBaPS+BKXdFu/1bAXtIMNTx3QPbVewjipNq06nNodxWI28I1lCUsvv2+wB1joepzynLVW3g2nz0k9vaCRDoK6=", "port":"4675", "username":"testname" }, "data": [ { "index": 0, "stream_type": 1, "device_id":"07211540881586160101#f7964493ff764bbf9294d58b22e63de6" } ] }, "output": { "dis": { "stream_name": "dis-abandondetection-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": { "detection_min_size": 50, "alert_time_threshold": 10, "alert_detection_interval": 5, "image_compression_ratio": 80, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "render_result_sw": 1, "render_roi_sw": 1 } } } 参数说明 参数 是否必选 类型 说明 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参数说明 字段 是否必选 类型 说明 detection_min_size 否 Int 对应控制台的界面参数“检测目标最小像素值”。 检测目标的长宽最小像素值,与分辨率成正比,在1080p分辨率下,取值范围为[50, 400],默认值为50。 alert_time_threshold 否 Int 对应控制台的界面参数“告警时间阈值”。 遗留物告警时间阈值,目标产生告警时的遗留时间不少于该时间。 单位为秒,取值范围[10, 300],默认值为10。 alert_detection_interval 否 Int 对应控制台的界面参数“检测周期”。 遗留物告警检测周期。如果在一个周期内有多个告警,则合并为一个告警。 单位为秒,取值范围为[1, 150],默认值为5,建议取值范围为[1, alert_time_threshold/2]。 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 图片压缩百分比,取值范围为[20,100]。 默认值:90,表示图片压缩比为90%。 target_roi 否 String 对应控制台的界面参数“检测区域设置”。 表示检测区域,该字段为JSON格式的字符串,API调用时需要加转义符。详细JSON格式参见target_roi(目标区域)。 例如: {"polygons":[{"data":[[84,389],[1840,349],[1824,526],[78,526]]}]} 参数没有携带时,默认区域为整个视频帧。 render_result_sw 否 Int 对应控制台的界面参数“目标框渲染开关”。 输出图像是否绘制告警目标边框,取值范围: "0":表示不绘制。 "1":表示用红色绘制告警目标边框。 默认值为0。 render_roi_sw 否 Int 对应控制台的界面参数“检测区域渲染开关”。 输出图像是否绘制检测区域,取值范围: "0":表示不绘制。 "1":表示用黄色绘制用户设定区域。 默认值为0。
  • 请求 请求样例1(摄像头输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-sharedbicycledetection-edge/tasks { "name": "sharedbicycledetection-edge-task", "description": "Sharedbicycledetection task test", "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_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "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]],\"name\":\"illegal01\"}]}", "image_compression_ratio":90 } } } 请求样例2(edgerestful输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-sharedbicycledetection-edge/tasks { "name": "sharedbicycledetection-edge-task", "description": "Sharedbicycledetection 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-sharedbicycledetection-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": { "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]],\"name\":\"illegal01\"}]}", "image_compression_ratio":90 } } } 请求样例3(VCN输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-sharedbicycledetection-edge/tasks { "name": "sharedbicycledetection-edge-task", "description": "Sharedbicycledetection 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-sharedbicycledetection-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": { "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]],\"name\":\"illegal01\"}]}", "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参数说明 字段 是否必选 类型 说明 alert_mode 否 String 对应控制台的界面参数“告警模式”。 共享单车违停告警模式,共有两种告警模式: "single": 表示单次告警模式,每当出现新的告警目标时,上报告警信息。 "periodic": 表示周期告警模式,每过一个检测周期,上报当前所有告警目标信息。 默认值:"single"。 alert_detection_interval 否 Int 对应控制台的界面参数“检测周期”。 共享单车违停检测周期,单位为秒。取值范围为[1, 3600]。 默认值:60。 illegal_park_alert_threshold 否 Int 对应控制台的界面参数“告警触发时间”。 告警触发时间阈值,单位秒,取值范围[10,300]。共享单车停留超过这个时间则告警。 默认值:30。 all_print 否 Int 对应控制台的界面参数“全告警渲染开关”。 是否开启全渲染开关在输出图片中,取值范围[0, 1],默认值为0: "0":表示绘制只当前告警的目标边框,渲染方式见normal_render字段介绍; "1":表示在画面中绘制所有告警过的违停共享单车,新增的告警目标与其余渲染目标在框的颜色上有所区分。 当normal_render为0时,当前告警用红框+warning标志+红色底色渲染,历史告警用黄框+黄色底色渲染。 当normal_render为1时,当前告警用红框渲染,历史告警用暗红色框渲染。 只有在目标框渲染开关打开时,该字段才会生效。 render_result_sw 否 Int 对应控制台的界面参数“目标框渲染开关”。 是否开启检测框渲染在输出图片中(渲染方式见normal_render字段说明),取值范围: "0":表示不绘制。 "1":表示用绘制告警目标边框。 默认值为0。 target_roi 否 String 对应控制台的界面参数“区域设置”。 禁止停车区域,区域参数用"name":"illegal*"标识。当有车辆停在禁止停车区域,则会触发违停事件。illegal后面可以加其他字段作为roi的标志,如illegal01。 若name为"illegal"开头以外的任何值,该区域默认为合法停车区域。 该字段为JSON格式的字符串,API调用时需要加转义符。详细JSON格式参见target_roi(目标区域) 例如: {"polygons":[{"data":[[84,389],[1840,349],[1824,526],[78,526]],"name":"illegal01"}]} 参数没有携带时,默认整个视频帧都不是合法停车区,都是禁止停车区域。 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 图片压缩百分比,取值范围为[20,100]。 默认值:90,表示图片压缩比为90%。 normal_render 否 Int 对应控制台的界面参数“经典渲染开关”。取值范围[0,1]。默认值为0。 当all_print字段为0时,采用如下方式进行画面目标渲染: 当为1时,对目标框采用红框标记。 当为0时,对目标框采用红色边框+红色底色,同时在框左上角位置标上warning标志。 当all_print字段为1时,仍需参考all_print的值进行画面渲染,详见all_print字段介绍。
  • 响应 响应样例 { "id":"61761681a6014e7c9024d642a0d4d412", "name":"vehicleflowdetection-edge-task", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"Vehicleflowdetection task test", "service_version":"3.0", "edge_pool_id":"793f2ae4032b44929cfec2dbcca7c415", "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,606],[100,616]],\"properties\":{\"type\":0}},{\"data\":[[50,756],[100,616]],\"properties\":{\"type\":1}},{\"data\":[[50,256],[100,116]],\"properties\":{\"type\":1}}]}", "flow_output_interval":1 } } } 响应参数说明 请参考作业详情参数。
  • 响应 响应样例(VIS输入+DIS输出) { "id": "3d7c81cf35784d88a4e26066bcc5debd", "name": "smoke-and-fire-cloud-task", "creator": "user_test", "project_id": "1f793beac00d4801874db741cbfe10fa", "description": null, "service_version": "3.0", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at": "2020-09-22T07:37:03Z", "updated_at": "2020-09-22T07:37:03Z", "state": "RUNNING", "input": { "type": "vis", "data": [ { "stream_name": "vis-vias", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-vias" } }, "service_config": { "common": { "image_compression_ratio": 90, "render_result_sw": 1, "video_sampling_interval": 1, "target_roi": "{\"polygons\":[{\"data\":[[204,64],[90,321],[511,319],[617,221],[582,38],[320,11],[228,24]]}]}", "render_roi_sw": 1, "fire_detection_sw": 1, "smoke_detection_sw": 1 } } } 响应参数说明 请参考作业详情参数。
  • 响应 响应样例 { "id":"61761681a6014e7c9024d642a0d4d412", "name":"congestiondetection-edge-task", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"Congestiondetection task test", "service_version":"3.0", "edge_pool_id":"793f2ae4032b44929cfec2dbcca7c415", "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\":[[253,169],[1,1063]]},{\"data\":[[460,170],[1008,789]]},{\"data\":[[775,171],[1917,589]]}]}", "output_image_sw":1, "congestion_output_interval":1, "rendering_sw":0 } } } 响应参数说明 请参考作业详情参数。
  • 响应 响应样例 { "id":"9e64eeff407647f28201419e5ce3eacd", "name":"trash-overflow-edge-task", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"trash-overflow-edge task test", "service_version":"3.0", "edge_pool_id":"8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-22T04:48:30Z", "updated_at":"2020-09-22T04:48:30Z", "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":{ "trash_overflow_interval":300, "render_result_sw":1, "render_roi_sw":1, "target_roi":"{\"polygons\":[{\"data\":[[80,570],[337,565],[339,889],[80,891]]}]}", "image_compression_ratio":90 } } } 响应参数说明 请参考作业详情参数。
  • 响应 响应样例(VIS输入+DIS输出) { "id":"286c2b7af15346c3932b6de67b568097", "name":"flowcount_cloud_0", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"flowcount task test", "service_version":"3.0", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-22T06:30:00Z", "updated_at":"2020-09-22T06:30:00Z", "state":"RUNNING", "input":{ "type":"vis", "data":[ { "stream_name":"flowcount", "index":0 } ] }, "output":{ "dis":{ "stream_name":"dis-flowcount" } }, "service_config":{ "common":{ "line_count_interval":2, "region_count_interval":2, "line_detection_sw":1, "region_detection_sw":1, "heatmap_detection_sw":0, "heatmap_detection_interval":60, "target_roi": "{\"lines\":[{\"data\":[[560,680],[1185,506]],\"properties\":{\"side1_name\":\"Side1\",\"side2_name\":\"Side2\"}}],\"polygons\":[{\"data\":[[0,0],[0,1080],[1920,1080],[1920,0]]}]}", "heatmap_point_interval":4 } } } 响应参数说明 请参考作业详情参数。
  • 请求 请求样例1(摄像头输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-smoke-and-fire-edge/tasks { "name": "smoke-and-fire-edge-task", "description": "smoke-and-fire-edge-task", "input": { "type": "edgecamera", "data": [ { "id": "aec5857c-222f-4aa9-be39-23654e118886", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-smoke-and-fire-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": { "image_compression_ratio": 90, "render_result_sw": 1, "video_sampling_interval": 1, "target_roi": "{\"polygons\":[{\"data\":[[204,64],[90,321],[511,319],[617,221],[582,38],[320,11],[228,24]]}]}", "render_roi_sw": 1, "fire_detection_sw": 1, "smoke_detection_sw": 1 } } } 请求样例2(edgerestful输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-smoke-and-fire-edge/tasks { "name": "smoke-and-fire-edge-task", "description": "smoke-and-fire-edge-task", "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-smoke-and-fire-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": { "image_compression_ratio": 90, "render_result_sw": 1, "video_sampling_interval": 1, "target_roi": "{\"polygons\":[{\"data\":[[204,64],[90,321],[511,319],[617,221],[582,38],[320,11],[228,24]]}]}", "render_roi_sw": 1, "fire_detection_sw": 1, "smoke_detection_sw": 1 } } } 请求样例3(VCN输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-smoke-and-fire-edge/tasks { "name": "smoke-and-fire-edge-task", "description": "smoke-and-fire-edge-task", "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-smoke-and-fire-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": { "image_compression_ratio": 90, "render_result_sw": 1, "video_sampling_interval": 1, "target_roi": "{\"polygons\":[{\"data\":[[204,64],[90,321],[511,319],[617,221],[582,38],[320,11],[228,24]]}]}", "render_roi_sw": 1, "fire_detection_sw": 1, "smoke_detection_sw": 1 } } } 参数说明 参数 是否必选 类型 说明 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参数说明 字段 是否必选 类型 说明 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 图片压缩百分比,取值范围为[20,100]。 默认值:90,表示图片压缩比为90%。 render_result_sw 否 Int 对应控制台的界面参数“检测结果渲染开关”。 输出图像是否绘制告警目标边框,取值范围: "0":表示不绘制; "1":表示当告警为烟时,用紫色绘制告警目标框;当告警为火时,用红色绘制告警目标框。 默认值为0。 video_sampling_interval 否 Int 该参数已失效。 对应控制台的界面参数“视频采样间隔时间”。 单位秒,默认值: 1,取值范围[1, 10]。 注意:此参数决定了算法检测的频率,时间间隔增加,烟或火从发生到检测的最大时延会增加,建议根据可接受的实际响应延时设置此参数。 target_roi 否 String 对应控制台的界面参数“检测区域设置”。 表示检测区域,该字段为JSON格式的字符串,API调用时需要加转义符。详细JSON格式参见target_roi(目标区域)。 例如: {"polygons":[{"data":[[0,0],[0,1080],[1920,1080],[1920,0]]}]} 参数没有携带时,默认区域为整个视频帧。 render_roi_sw 否 Int 对应控制台的界面参数“检测区域渲染开关”。 输出图像是否绘制检测区域,取值范围: "0":表示不绘制。 "1":表示用黄色绘制用户设定区域。 默认值为0。 fire_detection_sw 否 Int 对应控制台的界面参数“明火检测开关”。 是否检测明火,取值范围: "0":表示关闭。 "1":表示开启。 默认值为1。 smoke_detection_sw 否 Int 对应控制台的界面参数“烟雾检测开关”。 是否检测烟雾,取值范围: "0":表示关闭。 "1":表示开启。 默认值为1。
  • 响应 响应样例 { "id":"cb088e91e03b4e4a87d55bbaae1debe0", "name":"intrusion-T4M-edge_0", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"intrusion 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":{ "car_detection_sw":0, "person_detection_sw":1, "detection_min_size":60, "detection_max_size":1080, "line_detection_sw":1, "region_detection_sw":1, "loitering_detection_sw":0, "image_compression_ratio":90, "render_result_sw":1, "all_print_sw":0, "target_roi": "{\"lines\":[{\"data\":[[560,680],[1185,506]],\"properties\":{\"side1_name\":\"Side1\",\"side2_name\":\"Side2\"}}],\"polygons\":[{\"data\":[[0,0],[0,1080],[1920,1080],[1920,0]]}]}", "render_roi_sw":1 } } } 响应参数说明 请参考作业详情参数。
  • 响应 响应样例 { "id":"8656efdafebf440bb7008f174db6c567", "name":"c-non-motor-detection-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":{ "illegal_park_detection_sw":1, "illegal_park_alert_threshold":30, "intrusion_detection_sw":0, "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 } } } 响应参数说明 请参考作业详情参数。
  • 请求 请求样例1(VCN输入+WEBHOOK输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-trash-overflow-edge/tasks { "name": "trash-overflow-task", "description": "trash-overflow 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": { "trash_overflow_interval": 300, "render_result_sw": 1, "render_roi_sw": 1, "target_roi":"{\"polygons\":[{\"data\":[[80,570],[337,565],[339,889],[80,891]]}]}", "image_compression_ratio": 90 } } } 请求样例2(摄像头输入+DIS输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-trash-overflow-edge/tasks { "name": "trash-overflow-edge-task", "description": "trash-overflow-edge task test", "input": { "type": "edgecamera", "data": [ { "id": "aec5857c-222f-4aa9-be39-23654e118886", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-trash-overflow-edge" } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "trash_overflow_interval": 300, "render_result_sw": 1, "render_roi_sw": 1, "target_roi":"{\"polygons\":[{\"data\":[[80,570],[337,565],[339,889],[80,891]]}]}", "image_compression_ratio": 90 } } } 请求样例3(edgerestful输入+DIS输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-trash-overflow-edge/tasks { "name": "trash-overflow-edge-task", "description": "trash-overflow-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-trash-overflow-edge" } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "trash_overflow_interval": 300, "render_result_sw": 1, "render_roi_sw": 1, "target_roi":"{\"polygons\":[{\"data\":[[80,570],[337,565],[339,889],[80,891]]}]}", "image_compression_ratio": 90 } } } 请求样例4(VCN输入+DIS输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-trash-overflow-edge/tasks { "name": "trash-overflow-task", "description": "trash-overflow 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-trash-overflow-edge" } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "trash_overflow_interval": 300, "render_result_sw": 1, "render_roi_sw": 1, "target_roi":"{\"polygons\":[{\"data\":[[80,570],[337,565],[339,889],[80,891]]}]}", "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参数结构说明 字段 是否必选 类型 说明 trash_overflow_interval 否 Int 对应控制台的界面参数“检测周期”。 垃圾桶满溢检测周期,单位为秒。取值范围为[300, 3600],默认值为300。当时间到达检测周期整数倍时,触发算法检测设定区域中的垃圾桶是否满溢。 render_result_sw 否 Int 对应控制台的界面参数“目标框渲染开关”。 输出图像是否绘制告警目标边框,默认值为0,取值范围: 0:表示不绘制。 1:表示用红色绘制告警目标边框。 render_roi_sw 否 Int 对应控制台的界面参数“检测区域渲染开关”。 输出图像是否绘制检测区域,默认值为0,取值范围: 0:表示不绘制。 1:表示用黄色绘制用户设定区域。 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-queue-status-analysis-edge/tasks { "name": "queue-status-analysis-edge_task", "description": "queue-status-analysis-edge_task", "input": { "type": "edgecamera", "data": [ { "id": "9f8933c9-448c-48e5-8bc0-631ea83b92eb", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-queue-status-analysis" }, "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": { "image_compression_ratio": 90, "render_result_sw": 1, "render_roi_sw": 1, "queue_status_analysis_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[0, 0], [0, 1000], [1920, 1000], [1920, 0]]}]}" } } } 请求样例2(edgerestful输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-queue-status-analysis-edge/tasks { "name":"queue-status-analysis-edge_task", "description":"queue-status-analysis-edge_task", "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-queue-status-analysis" }, "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":{ "image_compression_ratio":90, "render_result_sw":1, "render_roi_sw":1, "queue_status_analysis_sw":1, "target_roi":"{\"polygons\":[{\"data\":[[0, 0], [0, 1000], [1920, 1000], [1920, 0]]}]}" } } } 请求样例3(VCN输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-queue-status-analysis-edge/tasks { "name":"queue-status-analysis-edge_task", "description":"queue-status-analysis-edge_task", "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-queue-status-analysis" }, "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":{ "image_compression_ratio":90, "render_result_sw":1, "render_roi_sw":1, "queue_status_analysis_sw":1, "target_roi":"{\"polygons\":[{\"data\":[[0, 0], [0, 1000], [1920, 1000], [1920, 0]]}]}" } } } 参数说明 参数 是否必选 类型 说明 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参数说明 字段 是否必选 类型 说明 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 图片压缩百分比,取值范围为[20,100]。 默认值:90,表示图片压缩比为90%。 render_result_sw 否 Int 对应控制台的界面参数“目标框渲染开关”。 输出图像是否绘制告警目标边框,取值范围: "0":表示不绘制。 "1":表示用红色绘制告警目标边框。 默认值为0。 render_roi_sw 否 Int 对应控制台的界面参数“检测区域渲染开关”。 输出图像是否绘制检测区域,取值范围: "0":表示不绘制。 "1":表示用黄色绘制用户设定区域。 默认值为0。 queue_status_analysis_sw 否 Int 对应控制台的界面参数“排队状态分析开关”。 取值范围: "0":表示不开启。 "1":表示开启。 默认值为1。 target_roi 否 String 对应控制台的界面参数“检测区域设置”。 表示检测区域,该字段为JSON格式的字符串,API调用时需要加转义符。详细JSON格式参见target_roi(目标区域)。 例如: {"polygons":[{"data":[[84,389],[1840,349],[1824,526],[78,526]]}]} 参数没有携带时,默认区域为整个视频帧中间的1/4。 当target_roi参数未设置时,区域默认位置如图1所示,其中Wframe为帧宽度,Hframe为帧高度。 图1 区域默认位置 默认区域为矩形,假设矩形的四个端点分别为point_1、point_2、point_3、point_4,其位置默认为: poin_1=(¼Wframe, ¼Hframe) poin_2=(¾Wframe, ¼Hframe) poin_3=(¼Wframe, ¾Hframe) poin_4=(¾Wframe, ¾Hframe)
  • 响应 响应样例 { "id":"2f268b9472a544e991eae3c5c3534f5b", "name":"烟火检测-T4N-edge_0", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"smoke-and-fire-edge task test", "service_version":"3.0", "edge_pool_id":"066800ca793e47dcbd4191e8029f46c6", "created_at":"2020-09-19T07:03:29Z", "updated_at":"2020-09-19T07:03:29Z", "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":{ "image_compression_ratio":90, "render_result_sw":1, "video_sampling_interval":1, "target_roi": "{\"polygons\":[{\"data\":[[204,64],[90,321],[511,319],[617,221],[582,38],[320,11],[228,24]]}]}", "render_roi_sw":1, "fire_detection_sw": 1, "smoke_detection_sw": 1 } } } 响应参数说明 请参考作业详情参数。
  • 响应 响应样例 { "id": "8d7c029b01c64abf9630f40b7dbfb067", "name": "人脸提取-T4M-edge-0", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description": "face detection task test", "service_version": "3.0", "edge_pool_id": "e9bf9ebe497d4c9bb2e65d1f99fe1ff9", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at": "2020-09-10T06:56:56Z", "updated_at": "2020-09-10T07:01:43Z", "state": "RUNNING", "input": { "type": "edgecamera", "data": [{ "id": "5213039b-698f-4347-8ced-ef0d14605c0b" }] }, "output": { "webhook":{ "url":"https://apigw.xx.com/api/mqs/sit", "headers":{ "content-type":"application/json" }, "data_category":[ "FaceImage", "OriginImage" ] } }, "service_config": { "common": { "detection_max_size": 800, "detection_min_size": 120, "origin_image_send_sw": 0, "face_first_send_threshold": 0.0, "face_must_send_sw": 0, "face_repeat_send_sw": 1, "face_repeat_send_mode": "PERIOD", "face_repeat_send_step": 1, "face_repeat_send_interval": 1, "target_roi": "{\"polygons\":[{\"data\":[[100,100],[1800,100],[1800,1000],[100,1000]]}]}", "image_compression_ratio": 90 } } } 响应参数说明 请参考作业详情参数。
  • 请求 请求样例1(摄像头输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-intrusiondetection-edge/tasks { "name": "intrusiondetection-edge-task", "description": "Intrusion task test", "input": { "type": "edgecamera", "data": [ { "id": "aec5857c-222f-4aa9-be39-23654e118886", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-intrusiondetection-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": { "car_detection_sw": 0, "person_detection_sw": 1, "detection_min_size": 60, "detection_max_size": 1080, "line_detection_sw": 1, "region_detection_sw": 1, "loitering_detection_sw": 0, "all_print_sw": 0, "target_roi": "{\"lines\":[{\"data\":[[560,680],[1185,506]],\"properties\":{\"side1_name\":\"Side1\",\"side2_name\":\"Side2\"}}],\"polygons\":[{\"data\":[[0,0],[0,1080],[1920,1080],[1920,0]]}]}", "image_compression_ratio":90, "render_result_sw": 1, "render_roi_sw": 1 } } } 请求样例2(edgerestful输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-intrusiondetection-edge/tasks { "name": "intrusiondetection-edge-task", "description": "Intrusion 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-surveillance-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": { "car_detection_sw": 0, "person_detection_sw": 1, "detection_min_size": 60, "detection_max_size": 1080, "line_detection_sw": 1, "region_detection_sw": 1, "loitering_detection_sw": 0, "all_print_sw": 0, "target_roi": "{\"lines\":[{\"data\":[[560,680],[1185,506]],\"properties\":{\"side1_name\":\"Side1\",\"side2_name\":\"Side2\"}}],\"polygons\":[{\"data\":[[0,0],[0,1080],[1920,1080],[1920,0]]}]}", "image_compression_ratio":90, "render_result_sw": 1, "render_roi_sw": 1 } } } 请求样例3(VCN输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-intrusiondetection-edge/tasks { "name": "surveillance-edge-task", "description": "Intrusion task test", "input": { "type": "vcn", "vcn":{ "ip":"172.100.119.6", "password":"CQeNfcRLwyMvH77AkDBaPS+BKXdFu/1bAXtIMNTx3QPbVewjipNq06nNodxWI28I1lCUsvv2+wB1joepzynLVW3g2nz0k9vaCRDoK6=", "port":"4675", "username":"testname" }, "data": [ { "index": 0, "stream_type": 1, "device_id":"07211540881586160101#f7964493ff764bbf9294d58b22e63de6" } ] }, "output": { "dis": { "stream_name": "dis-intrusiondetection-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": { "car_detection_sw": 0, "person_detection_sw": 1, "detection_min_size": 60, "detection_max_size": 1080, "line_detection_sw": 1, "region_detection_sw": 1, "loitering_detection_sw": 0, "all_print_sw": 0, "target_roi": "{\"lines\":[{\"data\":[[560,680],[1185,506]],\"properties\":{\"side1_name\":\"Side1\",\"side2_name\":\"Side2\"}}],\"polygons\":[{\"data\":[[0,0],[0,1080],[1920,1080],[1920,0]]}]}", "image_compression_ratio":90, "render_result_sw": 1, "render_roi_sw": 1 } } } 参数说明 参数 是否必选 类型 说明 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参数说明 字段 是否必选 类型 说明 car_detection_sw 否 Int 对应控制台的界面参数“车检测开关”。 检测车开关: 0:表示不检测。 1:表示检测。 默认值为0。 person_detection_sw 否 Int 对应控制台的界面参数“人检测开关”。 检测人开关: 0:表示不检测。 1:表示检测。 默认值为1。 detection_min_size 否 Int 对应控制台的界面参数“检测目标最小像素值”。 检测目标的长宽最小像素值,取值范围为[60, 4000],默认值为60。 detection_max_size 否 Int 对应控制台的界面参数“检测目标最大像素值”。 检测目标的长宽最大像素值,取值范围为[640, 4000],默认值为1080。 line_detection_sw 否 Int 对应控制台的界面参数“过线检测开关”。 过线入侵检测开关: 0:表示关闭。 1:表示开启。 默认值为1。 region_detection_sw 否 Int 对应控制台的界面参数“区域检测开关”。 区域入侵检测开关: 0:表示关闭。 1:表示开启。 默认值为1。 loitering_detection_sw 否 Int 对应控制台的界面参数“徘徊检测开关”。 徘徊检测开关: 0:表示关闭。 1:表示开启。 默认值为0。检测范围与areaSetting区域设置一致。 target_roi 否 String 对应控制台的界面参数“检测区域设置”。 表示检测区域,该字段为JSON格式的字符串,API调用时需要加转义符。详细JSON格式参见target_roi(目标区域)。 例如: {"lines":[{"data":[[560,680],[1185,506]],"properties":{"side1_name":"Side1","side2_name":"Side2"}}],"polygons":[{"data":[[0,0],[0,1080],[1920,1080],[1920,0]]}]} 参数没有携带时,默认区域为整个视频帧。 直线与区域默认位置如图1所示。 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 图片压缩百分比,取值范围为[20,100]。 默认值:90,表示图片压缩比为90%。 render_result_sw 否 Int 对应控制台的界面参数“目标框渲染开关”。 输出图像是否绘制告警目标边框,取值范围: "0":表示不绘制; "1":表示用红色绘制告警目标边框。 默认值为0。 render_roi_sw 否 Int 对应控制台的界面参数“检测区域渲染开关”。 输出图像是否绘制检测区域,取值范围: "0":表示不绘制; "1":表示用黄色绘制用户设定区域。 默认值为0。 all_print_sw 否 Int 对应控制台的界面参数“全告警渲染开关”。 输出是否包含历史告警结果,取值范围: 0:表示关闭。 1:表示开启。 默认值为0。 当target_roi参数未设置时,直线与区域默认位置如图1所示,其中Wframe为帧宽度,Hframe为帧高度。 图1 直线与区域默认位置 直线两端点point_1与point_2默认值为: point_1=(¼Wframe, ½Hframe) point_2=(¾Wframe, ½Hframe) 默认区域为整个视频帧。
  • 响应 响应样例(VIS输入+DIS输出) { "id": "3d7c81cf35784d88a4e26066bcc5debd", "name": "abandon-cloud-task", "creator": "user_test", "project_id": "1f793beac00d4801874db741cbfe10fa", "description": null, "service_version": "3.0", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at": "2020-09-22T07:37:03Z", "updated_at": "2020-09-22T07:37:03Z", "state": "RUNNING", "input": { "type": "vis", "data": [ { "stream_name": "vis-vias", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-vias" } }, "service_config": { "common": { "detection_min_size": 50, "alert_time_threshold": 10, "alert_detection_interval": 5, "image_compression_ratio": 80, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "render_result_sw": 1, "render_roi_sw": 1 } } } 响应参数说明 请参考作业详情参数。
  • 请求 请求样例1(摄像头输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-flowcount-edge/tasks { "name": "flowcount-edge-task", "description": "flowcount task test", "input": { "type": "edgecamera", "data": [ { "id": "aec5857c-222f-4aa9-be39-23654e118886", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-flowcount-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": { "line_count_interval":2, "region_count_interval":2, "line_detection_sw":1, "region_detection_sw":1, "target_roi":"{\"lines\":[{\"data\":[[560,680],[1185,506]],\"properties\":{\"side1_name\":\"Side1\",\"side2_name\":\"Side2\"}}],\"polygons\":[{\"data\":[[0,0],[0,1080],[1920,1080],[1920,0]]}]}", "heatmap_detection_sw":0, "heatmap_detection_interval":60, "heatmap_point_interval":4 } } } 请求样例2(edgerestful输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-flowcount-edge/tasks { "name":"flowcount-task", "description":"flowcount 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-flowcount-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":"9358ac0425b24a07b3258cffa2f0f0d6", "service_config":{ "common":{ "line_count_interval":2, "region_count_interval":2, "line_detection_sw":1, "region_detection_sw":1, "target_roi":"{\"lines\":[{\"data\":[[560,680],[1185,506]],\"properties\":{\"side1_name\":\"Side1\",\"side2_name\":\"Side2\"}}],\"polygons\":[{\"data\":[[0,0],[0,1080],[1920,1080],[1920,0]]}]}", "heatmap_detection_sw":0, "heatmap_detection_interval":60, "heatmap_point_interval":4 } } } 请求样例3(VCN输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-flowcount-edge/tasks { "name":"flowcount-task", "description":"flowcount task test", "input": { "type": "vcn", "vcn":{ "ip":"172.100.119.6", "password":"CQeNfcRLwyMvH77AkDBaPS+BKXdFu/1bAXtIMNTx3QPbVewjipNq06nNodxWI28I1lCUsvv2+wB1joepzynLVW3g2nz0k9vaCRDoK6=", "port":"4675", "username":"testname" }, "data": [ { "index": 0, "stream_type": 1, "device_id":"07211540881586160101#f7964493ff764bbf9294d58b22e63de6" } ] }, "output": { "dis": { "stream_name": "dis-flowcount-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":"9358ac0425b24a07b3258cffa2f0f0d6", "service_config":{ "common":{ "line_count_interval":2, "region_count_interval":2, "line_detection_sw":1, "region_detection_sw":1, "target_roi":"{\"lines\":[{\"data\":[[560,680],[1185,506]],\"properties\":{\"side1_name\":\"Side1\",\"side2_name\":\"Side2\"}}],\"polygons\":[{\"data\":[[0,0],[0,1080],[1920,1080],[1920,0]]}]}", "heatmap_detection_sw":0, "heatmap_detection_interval":60, "heatmap_point_interval":4 } } } 参数说明 参数 是否必选 类型 说明 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参数说明 字段 是否必选 类型 说明 line_count_interval 否 Int 过线人流量统计周期,单位为秒,统计的是一段时间的人流量结果。取值范围为(0, 86400],默认值为2。 region_count_interval 否 Int 区域人流量统计周期,单位为秒,统计的是当前时刻的区域人流量结果。取值范围为(0, 86400],默认值为2。 line_detection_sw 否 Int 过线人流量统计开关。 0:表示不开启。 1:表示开启。 默认值为1 region_detection_sw 否 Int 区域人流量统计开关。 0:表示不开启。 1:表示开启。 默认值为1 target_roi 否 string 对应控制台的界面参数“检测区域设置”。 表示检测区域,该字段为JSON格式的字符串,API调用时需要加转义符。详细JSON格式参见target_roi(目标区域)。 例如: {"lines":[{"data":[[560,680],[1185,506]],"properties":{"side1_name":"Side1","side2_name":"Side2"}}],"polygons":[{"data":[[0,0],[0,1080],[1920,1080],[1920,0]]}]} 参数没有携带时,默认位置请参见直线与区域默认位置。 heatmap_detection_sw 否 Int 热力图检测开关 0:表示不开启。 1:表示开启。 默认值为0 heatmap_detection_interval 否 Int 热力图检测周期,单位为秒。取值范围为[10, 86400],默认值为10。依据热力图检测周期内的热点值进行更新。 heatmap_point_interval 否 Int 热点更新周期,单位为帧。取值范围为[1, 10000],默认值为4。在热力图检测周期内,热点值逐渐累加。 当target_roi参数未设置时,直线与区域默认位置如图1所示,其中Wframe为帧宽度,Hframe为帧高度。 图1 直线与区域默认位置 直线两端点point_1与point_2默认值为: point_1=(¼Wframe, ½Hframe) point_2=(¾Wframe, ½Hframe) 默认区域为矩形,假设矩形的四个端点分别为point_1、point_2、point_3、point_4,其位置默认为: point_1=(¼Wframe, ¼Hframe) point_2=(¾Wframe, ¼Hframe) point_3=(¼Wframe, ¾Hframe) point_4=(¾Wframe, ¾Hframe)
  • 响应 响应样例(VIS输入+DIS输出) { "id": "3d7c81cf35784d88a4e26066bcc5debd", "name": "safetysuitedetection-cloud-task", "creator": "user_test", "project_id": "1f793beac00d4801874db741cbfe10fa", "description": null, "service_version": "3.0", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at": "2020-09-22T07:37:03Z", "updated_at": "2020-09-22T07:37:03Z", "state": "RUNNING", "input": { "type": "vis", "data": [ { "stream_name": "vis-vias", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-vias" } }, "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 } } } 响应参数说明 请参考作业详情参数。
  • 响应 响应样例(VIS输入+DIS输出) { "id":"8656efdafebf440bb7008f174db6c567", "name":"vehicledetection-cloud-task", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":null, "service_version":"3.0", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-18T03:35:03Z", "updated_at":"2020-09-18T03:35:51Z", "state":"RUNNING", "input":{ "type":"vis", "data":[ { "stream_name":"vis-vias", "index":0 } ] }, "output":{ "dis":{ "stream_name":"dis-vias" } }, "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 } } } 响应参数说明 请参考作业详情参数。
  • 响应 响应样例 { "id":"8656efdafebf440bb7008f174db6c567", "name":"c-highpoint-crowdcount-edge-edge", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":null, "service_version":"3.0", "edge_pool_id":"8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2021-01-26T03:35:03Z", "updated_at":"2021-01-26T03:35:51Z", "state":"RUNNING", "input":{ "type":"edgecamera", "data":[ { "id":"aec5857c-222f-4aa9-be39-23654e118886", "index":0 } ] }, "output":{ "webhook": { "url": "https://apigw.huawei.com/api/mqs/message/sit", "headers": { "content-type": "application/json" } } }, "service_config":{ "common":{ "event_disappear_alert_sw": 0, "image_compression_ratio": 90, "roadside_stall_detect_sw": 1, "outstore_stall _detect_sw": 0, "render_roi_sw": 1, "render_result_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}" } } } 响应参数说明 请参考作业详情参数。
  • 响应 响应样例 { "id":"ee7d7f5c7ba24839b6abaf5b81607496", "name":"flowcount-task", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"flowcount task test", "service_version":"3.0", "edge_pool_id":"9358ac0425b24a07b3258cffa2f0f0d6", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-23T06:19:44Z", "updated_at":"2020-09-23T06:19:44Z", "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":{ "line_count_interval":2, "region_count_interval":2, "line_detection_sw":1, "region_detection_sw":1, "heatmap_detection_sw":0, "heatmap_detection_interval":60, "heatmap_point_interval":4 } } } 响应参数说明 请参考作业详情参数。
  • 请求 请求样例1(摄像头输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-urban-trash-detect-edge/tasks { "name": "c-urban-trash-detect-edge-task", "description": "c-urban-trash-detect-edge test", "input": { "type": "edgecamera", "data": [ { "id": "25292206-995f-4c31-bfd5-b0dd7bc389e7", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-suxinxing" }, "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": { "image_compression_ratio": 90, "trash_detect_sw": 1, "person_constraint_sw": 0, "min_trash_size": 1, "render_roi_sw": 1, "render_result_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]],\"name\":\"a\"}]}" } } } 请求样例2(edgerestful输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-urban-trash-detect-edge/tasks { "name": "c-urban-trash-detect-edge-task", "description": "c-urban-trash-detect-edge 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-suxinxing" }, "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": { "image_compression_ratio": 90, "trash_detect_sw": 1, "person_constraint_sw": 0, "min_trash_size": 1, "render_roi_sw": 1, "render_result_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]],\"name\":\"a\"}]}" } } } 请求样例3(VCN输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-urban-trash-detect-edge/tasks { "name": "c-urban-trash-detect-edge-task", "description": "c-urban-trash-detect-edge 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-suxinxing" }, "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": { "image_compression_ratio": 90, "trash_detect_sw": 1, "person_constraint_sw": 0, "min_trash_size": 1, "render_roi_sw": 1, "render_result_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]],\"name\":\"a\"}]}" } } } 参数说明 参数 是否必选 类型 说明 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参数说明 字段 是否必选 类型 说明 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 图片压缩百分比,取值范围为[20,100]。 默认值:90,表示图片压缩比为90%。 trash_detect_sw 否 Int 对应控制台的界面参数“垃圾检测开关”。 "1":表示检测垃圾; "2":表示检测垃圾并检测疑似丢垃圾的人。 默认值为1。 person_constraint_sw 否 Int 对应控制台的界面参数“邻近行人约束开关”。当开关打开时,垃圾附近有行人逗留的告警将被过滤。 "0":表示不开启开关; "1":表示开启开关; 默认值为0。 min_trash_size 否 Int 对应控制台的界面参数“垃圾最小尺寸”。由于不同应用场景对垃圾的定义不同,用户可自定义配置垃圾最小尺寸,小于该尺寸的垃圾目标将不被告警。取值范围[1, 500]。单位为像素。 默认值为1。 render_result_sw 否 Int 对应控制台的界面参数“目标框渲染开关”。 输出图像是否绘制告警目标边框,取值范围: "0":表示不绘制; "1":表示用红色绘制告警目标边框。 默认值为0。 render_roi_sw 否 Int 对应控制台的界面参数“检测区域渲染开关”。 输出图像是否绘制检测区域,取值范围: "0":表示不绘制; "1":表示用黄色绘制用户设定区域。 默认值为0。 target_roi 否 String 对应控制台的界面参数“检测区域设置”。 表示检测区域,该字段为JSON格式的字符串,API调用时需要加转义符。格式参见设置taeget_roi。例如: {"polygons":[{"data":[[84,389],[1840,349],[1824,526],[78,526]],"name":"polygon"}]} 可为每个区域设置名称,后续输出结果时会连带输出区域名称。 参数没有携带时,默认区域为整个视频帧,默认区域名称为空字符串。
  • 响应 响应样例 { "id": "8656efdafebf440bb7008f174db6c567", "name": "queue-status-analysis-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": "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": { "image_compression_ratio": 90, "render_result_sw": 1, "render_roi_sw": 1, "queue_length_count_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[0, 0], [0, 1000], [1920, 1000], [1920, 0]]}]}" } } } 响应参数说明 请参考作业详情参数。
  • 响应 响应样例(VIS输入+DIS输出) { "id":"5c127c7844674d2382b7daae07794152", "name":"c-urban-trash-detect-cloud-test", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"c-urban-trash-detect-cloud 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":"vis-input", "index":0 } ] }, "output":{ "dis":{ "stream_name":"dis-output" } }, "service_config":{ "common":{ "image_compression_ratio": 90, "trash_detect_sw": 1, "render_roi_sw": 1, "render_result_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}" } } } 响应参数说明 请参考作业详情参数。
共100000条