更新时间:2024-03-18 GMT+08:00
分享

创建数据集版本

功能介绍

创建数据集版本

URI

POST /v1.0/{project_id}/common/datasets/{dataset_id}/versions

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目id,获取方法请参见获取项目ID

dataset_id

String

数据集id

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

Content-Type

String

内容类型。填application/json

X-Auth-Token

String

用户Token,通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)

表3 请求Body参数

参数

是否必选

参数类型

描述

batch_task_id

String

筛选标注任务(数据集来源(data_source)为标注(LABEL)时必填)

label_meta_names

Array of strings

标注名(数据集来源(data_source)为标注(LABEL)时必填)

only_valid

Boolean

标注帧:true:有效标注帧, false:无效标注帧, 该参数不传:全部标注帧(数据集来源为标注时选填参数)

hard_mining

Boolean

true:仅难例数据集,false:非难例数据集,该参数不传:全部数据集(数据集来源为标注时选填参数)

status

String

状态,数据集来源(data_source)为标注(LABEL)时必填

枚举值:

  • all(全部数据集)

  • labeled(已标注数据集)

description

String

描述

最大长度:256

bucket_path

String

obs文件夹地址(数据集来源为OBS时必填)

bucket_name

String

桶名(数据集来源为OBS时必填)

warehouse_params

WarehouseParam object

数据仓库筛选数据参数(数据集来源为数据仓库时必填)

custom_image

String

自定义镜像名称,形如"自定义镜像id:自定义镜像版本号"

command

String

脚本路徑

agreement_confirm

Boolean

隐私声明同意

tags

Array of strings

标签(数据集类型(dataset_type)为子集(SUBSET)时可通过tag进行过滤)

custom_attributes

Array of strings

自定义属性(数据集类型(dataset_type)为子集(SUBSET)时可通过自定义属性进行过滤)

表4 WarehouseParam

参数

是否必选

参数类型

描述

data_process_task_ids

Array of strings

数据处理任务id,当传多个时是或的查询条件

数组长度:0 - 5

raw_data_ids

Array of strings

原始数据id,当传多个时是或的查询条件

数组长度:0 - 5

start_time

Long

原始数据采集时间,起始时间,UTC标准时间毫秒时间戳

最小值:0

end_time

Long

原始数据采集时间,终止时间,UTC标准时间毫秒时间戳

最小值:0

file_name

String

文件名称,单个模糊匹配

最大长度:64

file_types

Array of strings

文件类型

数组长度:0 - 6

枚举值:

  • IMAGE(图片)

  • POINT_CLOUD(点云)

  • TEXT(文本)

  • VIDEO(视频)

  • SCENARIO(场景)

  • OTHERS(其他)

and_tags

Array of strings

标签id,当传多个时是且的查询条件

数组长度:0 - 5

or_tags

Array of strings

标签id,当传多个时是或的查询条件

数组长度:0 - 5

and_custom_attributes

Array of strings

自定义属性id查询条件,当传多个时是且的查询条件

数组长度:0 - 5

or_custom_attributes

Array of strings

自定义属性id查询条件,当传多个时是或的查询条件

数组长度:0 - 5

响应参数

状态码: 200

表5 响应Body参数

参数

参数类型

描述

payload

CreateDatasetVersionInfoPayload object

实际返回信息

meta_info

MetaInfo object

元数据

表6 CreateDatasetVersionInfoPayload

参数

参数类型

描述

item

LabelDatasetVersion object

版本信息

表7 LabelDatasetVersion

参数

参数类型

描述

id

String

id

label_dataset_id

String

数据集id

name

String

名称

batch_task_id

String

批次任务id

label_meta_names

Array of strings

标注物名

only_valid

Boolean

可用,true为可用,false为不可用

hard_mining

Boolean

难例,true为难例,false为非难例

label_format

String

标注格式

枚举值:

  • OCTOPUS(OCTOPUS格式)

  • USER_DEFINE(自定义格式)

status

String

状态

枚举值:

  • CREATING(创建中)

  • IN_INTEGRATION(整合中)

  • EXPORTING(导出中)

  • SUCCESS(成功)

  • INTEGRATION_FAILED(整合失败)

  • EXPORT_FAILED(导出失败)

  • EXPORT_PRE_SUCCESS(导出中)

  • UPLOAD_SUSPENDED(上传中断)

  • INITIALIZING(初始化)

frame_num

String

帧文件数量

frame_size

String

帧文件大小,包含单位

label_count

String

标志物数量

tags

Array of strings

标签

最大长度:64

custom_attributes

Array of strings

自定义属性,格式形式"key:value"

custom_image

String

自定义镜像

command

String

脚本路徑

description

String

描述

project_id

String

项目id

create_at

String

创建时间,UTC标准时间毫秒时间戳

update_at

String

修改时间,UTC标准时间毫秒时间戳

upload_id

String

上传id

agreement_confirm

Boolean

隐私声明同意

source_version_id

String

子集的源数据集版本ID

表8 MetaInfo

参数

参数类型

描述

current_time

String

请求时间,UTC时间格式,时间为UTC标准时间

请求示例

  • 创建数据仓库类型的数据集版本

    POST https://{endpoint}/v1.0/{project_id}/common/datasets/61a22ebc-49b3-40b5-b16f-ab9aebd2b231/versions
    
    {
      "agreement_confirm" : true,
      "description" : "数据集版本",
      "command" : "command",
      "custom_image" : "10293:1",
      "warehouse_params" : {
        "raw_data_ids" : [ "DPK0003878" ],
        "and_tags" : [ 956 ],
        "and_custom_attributes" : [ "61153deb-88ad-4f66-8bad-e3877bed309e" ],
        "file_types" : [ "TEXT" ],
        "start_time" : 1701360000000,
        "end_time" : 1701532799999
      }
    }
  • 创建标注类型的数据集版本

    POST https://{endpoint}/v1.0/{project_id}/common/datasets/61a22ebc-49b3-40b5-b16f-ab9aebd2b231/versions
    
    {
      "agreement_confirm" : true,
      "description" : "数据集版本",
      "command" : "command",
      "custom_image" : "10293:1",
      "status" : "labeled",
      "batch_task_id" : "e3d7ede3817541d29467388ac14b0eee",
      "label_meta_names" : [ "Person_sitting" ],
      "only_valid" : true,
      "hard_mining" : true
    }
  • 创建本地类型的数据集版本

    POST https://{endpoint}/v1.0/{project_id}/common/datasets/61a22ebc-49b3-40b5-b16f-ab9aebd2b231/versions
    
    {
      "agreement_confirm" : true,
      "description" : "数据集版本",
      "command" : "command",
      "custom_image" : "10293:1"
    }
  • 创建OBS类型的数据集版本

    POST https://{endpoint}/v1.0/{project_id}/common/datasets/61a22ebc-49b3-40b5-b16f-ab9aebd2b231/versions
    
    {
      "agreement_confirm" : true,
      "description" : "数据集版本",
      "command" : "command",
      "custom_image" : "10293:1",
      "bucket_name" : "octopus-raw-64d37c8f25af4277a1ff4ee9772687bf",
      "bucket_path" : "test/test"
    }
  • 创建子集版本

    POST https://{endpoint}/v1.0/{project_id}/common/datasets/61a22ebc-49b3-40b5-b16f-ab9aebd2b231/versions
    
    {
      "agreement_confirm" : true,
      "description" : "数据集版本",
      "command" : "command",
      "custom_image" : "10293:1"
    }

响应示例

状态码: 200

创建成功

  • 创建数据仓库类型的数据集版本

    {
      "meta_info" : {
        "current_time" : "2024-01-02T02:04:22Z"
      },
      "payload" : {
        "item" : {
          "id" : "102575d5-cf89-4aca-b856-0d39ae2a69c5",
          "label_dataset_id" : "61a22ebc-49b3-40b5-b16f-ab9aebd2b231",
          "name" : "V1",
          "label_format" : "OCTOPUS",
          "status" : "INITIALIZING",
          "frame_num" : 0,
          "frame_size" : 0,
          "label_count" : 0,
          "custom_image" : "10293:1",
          "command" : "command",
          "description" : "数据集版本",
          "project_id" : "64d37c8f25af4277a1ff4ee9772687bf",
          "create_at" : 1701403732492,
          "update_at" : 1701403732492,
          "agreement_confirm" : true
        }
      }
    }
  • 创建标注类型的数据集版本

    {
      "meta_info" : {
        "current_time" : "2024-01-02T02:04:22Z"
      },
      "payload" : {
        "item" : {
          "id" : "102575d5-cf89-4aca-b856-0d39ae2a69c5",
          "label_dataset_id" : "61a22ebc-49b3-40b5-b16f-ab9aebd2b231",
          "name" : "V1",
          "label_format" : "OCTOPUS",
          "status" : "INITIALIZING",
          "frame_num" : 0,
          "frame_size" : 0,
          "label_count" : 0,
          "custom_image" : "10293:1",
          "command" : "command",
          "description" : "数据集版本",
          "project_id" : "64d37c8f25af4277a1ff4ee9772687bf",
          "create_at" : 1701403732492,
          "update_at" : 1701403732492,
          "search_status" : "labeled",
          "hard_mining" : true,
          "only_valid" : true,
          "label_meta_names" : [ "Person_sitting" ],
          "batch_task_id" : "e3d7ede3817541d29467388ac14b0eee",
          "agreement_confirm" : true
        }
      }
    }
  • 创建本地类型的数据集版本

    {
      "meta_info" : {
        "current_time" : "2024-01-02T02:04:22Z"
      },
      "payload" : {
        "item" : {
          "id" : "102575d5-cf89-4aca-b856-0d39ae2a69c5",
          "label_dataset_id" : "61a22ebc-49b3-40b5-b16f-ab9aebd2b231",
          "name" : "V1",
          "label_format" : "OCTOPUS",
          "status" : "INITIALIZING",
          "frame_num" : 0,
          "frame_size" : 0,
          "label_count" : 0,
          "custom_image" : "10293:1",
          "command" : "command",
          "description" : "数据集版本",
          "project_id" : "64d37c8f25af4277a1ff4ee9772687bf",
          "create_at" : 1701403732492,
          "update_at" : 1701403732492,
          "agreement_confirm" : true
        }
      }
    }
  • 创建OBS类型的数据集版本

    {
      "meta_info" : {
        "current_time" : "2024-01-02T02:04:22Z"
      },
      "payload" : {
        "item" : {
          "id" : "102575d5-cf89-4aca-b856-0d39ae2a69c5",
          "label_dataset_id" : "61a22ebc-49b3-40b5-b16f-ab9aebd2b231",
          "name" : "V1",
          "label_format" : "OCTOPUS",
          "status" : "INITIALIZING",
          "frame_num" : 0,
          "frame_size" : 0,
          "label_count" : 0,
          "custom_image" : "10293:1",
          "command" : "command",
          "description" : "数据集版本",
          "project_id" : "64d37c8f25af4277a1ff4ee9772687bf",
          "create_at" : 1701403732492,
          "update_at" : 1701403732492,
          "agreement_confirm" : true
        }
      }
    }
  • 创建子集版本

    {
      "meta_info" : {
        "current_time" : "2024-01-02T02:04:22Z"
      },
      "payload" : {
        "item" : {
          "id" : "102575d5-cf89-4aca-b856-0d39ae2a69c5",
          "label_dataset_id" : "61a22ebc-49b3-40b5-b16f-ab9aebd2b231",
          "name" : "V1",
          "label_format" : "OCTOPUS",
          "status" : "INITIALIZING",
          "frame_num" : 0,
          "frame_size" : 0,
          "label_count" : 0,
          "custom_image" : "10293:1",
          "command" : "command",
          "description" : "数据集版本",
          "project_id" : "64d37c8f25af4277a1ff4ee9772687bf",
          "create_at" : 1701403732492,
          "update_at" : 1701403732492,
          "agreement_confirm" : true,
          "source_version_id" : "8d6df90a-8cd2-4ee6-ae12-36ae090600b5"
        }
      }
    }

状态码

状态码

描述

200

创建成功

400

参数校验失败

500

系统内部错误

错误码

请参见错误码

分享:

    相关文档

    相关产品