园区智能体 CampusGo-创建边缘个体动作检测作业:请求

时间:2023-11-01 16:13:47

请求

  • 请求样例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

    服务的算法配置,配置参数见ServiceConfig参数结构说明

  • service_config的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%。

support.huaweicloud.com/api-campusgo/campusgo_03_0073.html