创建数据集
功能介绍
创建数据集
URI
POST /v1.0/{project_id}/common/datasets
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
项目id,获取方法请参见获取项目ID |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
Content-Type |
是 |
String |
内容类型。填application/json |
X-Auth-Token |
是 |
String |
用户Token,通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值) |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
name |
是 |
String |
数据集名称 最小长度:1 最大长度:64 |
data_type |
是 |
String |
数据集数据类型 枚举值:
|
dataset_form |
是 |
String |
数据集形式 枚举值:
|
source_dataset_id |
否 |
String |
子集的源数据集id,当dataset_form取值为SUBSET时必填 |
data_source |
是 |
String |
数据集来源 枚举值:
|
description |
否 |
String |
描述 最大长度:256 |
label_format |
是 |
String |
标注格式 枚举值:
|
data_source_info |
是 |
DataSourceInfoRequest object |
数据集来源信息 |
label_taged |
否 |
Boolean |
是否是从标注服务创建的数据集,如果是则为true,如果不是则为false |
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
payload |
CreateDatasetPayload object |
实际返回信息 |
meta_info |
MetaInfo object |
元数据 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
id |
name |
String |
名称 |
description |
String |
描述 |
data_type |
String |
数据类型 枚举值:
|
dataset_form |
String |
数据集形式 枚举值:
|
source_dataset_id |
String |
子集的源数据集ID |
latest_version |
Integer |
最新版本 |
data_source |
String |
数据来源 枚举值:
|
frame_num |
Long |
文件数 |
frame_size |
Long |
数据集下版本帧文件总大小,单位字节 |
project_id |
String |
项目id |
label_format |
String |
标注格式 枚举值:
|
label_count |
Long |
标注物数量 |
label_names |
Array of strings |
标注物名 |
create_at |
Long |
创建时间,UTC标准时间毫秒时间戳 |
update_at |
Long |
修改时间,UTC标准时间毫秒时间戳 |
label_taged |
Boolean |
标注数据集tag,已标注是true |
label_associated |
Boolean |
标注服务中,标注任务是否关联该数据集,关联了为true |
data_source_info |
DataSourceInfoCreate object |
数据相关信息 |
tags |
Array of strings |
标签 最大长度:64 |
custom_attributes |
Array of strings |
自定义属性,格式形如"key:value" |
请求示例
-
创建数据仓库类型的数据集
POST https://{endpoint}/v1.0/{project_id}/common/datasets { "name" : "数据集-数据仓库", "description" : "测试数据集-数据仓库", "label_format" : "OCTOPUS", "data_type" : "IMAGE", "dataset_form" : "DATASET", "data_source" : "HOUSE", "label_taged" : false, "data_source_info" : { "data_warehouse_id" : "data_warehouse_id" } }
-
创建本地类型的数据集
POST https://{endpoint}/v1.0/{project_id}/common/datasets { "name" : "数据集-本地", "description" : "测试数据集-本地", "label_format" : "OCTOPUS", "data_type" : "IMAGE", "dataset_form" : "DATASET", "label_taged" : false, "data_source" : "LOCAL" }
-
创建标注类型的数据集
POST https://{endpoint}/v1.0/{project_id}/common/datasets { "name" : "数据集-标注", "description" : "测试数据集-标注", "label_format" : "OCTOPUS", "data_type" : "IMAGE", "dataset_form" : "DATASET", "data_source" : "LABEL", "label_taged" : false, "data_source_info" : { "label_project_package_id" : "80da34ab-7f5e-476e-b2ec-1a974ba8a4a5", "label_project_package_name" : "test-车道线-test" } }
-
创建OBS类型的数据集
POST https://{endpoint}/v1.0/{project_id}/common/datasets { "name" : "数据集-OBS", "description" : "测试数据集-OBS", "label_format" : "OCTOPUS", "data_type" : "IMAGE", "dataset_form" : "DATASET", "label_taged" : false, "data_source" : "OBS" }
-
创建子集
POST https://{endpoint}/v1.0/{project_id}/common/datasets { "name" : "数据集-子集", "description" : "测试数据集-子集", "dataset_form" : "SUBSET", "data_source" : "DATASET", "source_dataset_id" : "d6f9fdf1-99b3-457d-934b-14cce3265124" }
响应示例
状态码: 200
创建成功
-
创建数据仓库类型的数据集
{ "meta_info" : { "current_time" : "2024-01-02T02:04:22Z" }, "payload" : { "item" : { "id" : "61a22ebc-49b3-40b5-b16f-ab9aebd2b231", "name" : "数据集-数据仓库", "description" : "测试数据集-数据仓库", "data_type" : "IMAGE", "dataset_form" : "DATASET", "latest_version" : 0, "data_source" : "HOUSE", "frame_num" : 0, "frame_size" : 0, "project_id" : "64d37c8f25af4277a1ff4ee9772687bf", "label_format" : "OCTOPUS", "label_taged" : false, "label_associated" : false, "label_count" : 0, "create_at" : 1701403312027, "update_at" : 1701403312027, "data_source_info" : { "data_warehouse_id" : "ee9784a5-dde5-4a47-a006-fac074c5bee8" } } } }
-
创建本地类型的数据集
{ "meta_info" : { "current_time" : "2024-01-02T02:04:22Z" }, "payload" : { "item" : { "id" : "61a22ebc-49b3-40b5-b16f-ab9aebd2b231", "name" : "数据集-本地", "description" : "测试数据集-本地", "data_type" : "IMAGE", "dataset_form" : "DATASET", "latest_version" : 0, "data_source" : "LOCAL", "frame_num" : 0, "frame_size" : 0, "project_id" : "64d37c8f25af4277a1ff4ee9772687bf", "label_format" : "OCTOPUS", "label_taged" : false, "label_associated" : false, "label_count" : 0, "create_at" : 1701403312027, "update_at" : 1701403312027, "data_source_info" : { } } } }
-
创建标注类型的数据集
{ "meta_info" : { "current_time" : "2024-01-02T02:04:22Z" }, "payload" : { "item" : { "id" : "61a22ebc-49b3-40b5-b16f-ab9aebd2b231", "name" : "数据集-标注", "description" : "测试数据集-标注", "data_type" : "IMAGE", "dataset_form" : "DATASET", "latest_version" : 0, "data_source" : "LABEL", "frame_num" : 0, "frame_size" : 0, "project_id" : "64d37c8f25af4277a1ff4ee9772687bf", "label_format" : "OCTOPUS", "label_taged" : false, "label_associated" : false, "label_count" : 0, "create_at" : 1701403312027, "update_at" : 1701403312027, "data_source_info" : { "label_project_package_id" : "80da34ab-7f5e-476e-b2ec-1a974ba8a4a5", "label_project_package_name" : "projectName" } } } }
-
创建OBS类型的数据集
{ "meta_info" : { "current_time" : "2024-01-02T02:04:22Z" }, "payload" : { "item" : { "id" : "61a22ebc-49b3-40b5-b16f-ab9aebd2b231", "name" : "数据集-OBS", "description" : "测试数据集-OBS", "data_type" : "IMAGE", "dataset_form" : "DATASET", "latest_version" : 0, "data_source" : "OBS", "frame_num" : 0, "frame_size" : 0, "project_id" : "64d37c8f25af4277a1ff4ee9772687bf", "label_format" : "OCTOPUS", "label_taged" : false, "label_associated" : false, "label_count" : 0, "create_at" : 1701403312027, "update_at" : 1701403312027, "data_source_info" : { } } } }
-
创建子集
{ "meta_info" : { "current_time" : "2024-01-02T02:04:22Z" }, "payload" : { "item" : { "id" : "61a22ebc-49b3-40b5-b16f-ab9aebd2b231", "name" : "数据集-子集", "description" : "测试数据集-子集", "data_type" : "IMAGE", "dataset_form" : "SUBSET", "latest_version" : 0, "data_source" : "DATASET", "frame_num" : 0, "frame_size" : 0, "project_id" : "64d37c8f25af4277a1ff4ee9772687bf", "label_format" : "OCTOPUS", "label_taged" : false, "label_associated" : false, "label_count" : 0, "create_at" : 1701403312027, "update_at" : 1701403312027, "data_source_info" : { }, "source_dataset_id" : "d6f9fdf1-99b3-457d-934b-14cce3265124" } } }
状态码
状态码 |
描述 |
---|---|
200 |
创建成功 |
400 |
参数校验失败 |
500 |
系统内部错误 |
错误码
请参见错误码。