Data Operation
最后更新于
最后更新于
上传数据到数据集
用户往数据集中上传数据。
获取上传数据凭证
直传数据到oss
获取上传凭证
请求路径
GET /v1/datasets/{id}/policies
请求参数
Path
名称 | 是否必须 | 描述 |
---|---|---|
Query
名称 | 类型 | 是否必须 | 描述 |
---|---|---|---|
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/policies?expired=60&draftNumber=1' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"result": {
"OSSAccessKeyId": "OSSACCESSKEYID",
"Signature": "QbkCDeZtX37gb2zoemel3VCxz3k=",
"policy": "eyJjb25kaXRpb25zIjpbWyJzdGFydHMtd2l0aCIsIiRrZXkiLCI4ZjgzNWVlOWNmZWIwZDRlZjBkMmQyODJmOTdlNzM1OS9jOTQ4YTY0NC03NTJjLTRkOTItOTI3Yi1mNjkwYzYyZGM5Y2YvIl1dLCJleHBpcmF0aW9uIjoiMjAyMC0xMS0xM1QwMzozNjo1OVoifQ==",
"success_action_status": "200",
"multipleUploadLimit": 10
},
"extra": {
"backendType": "oss",
"host": "https://content-store-fat-version.oss-cn-qingdao.aliyuncs.com",
"objectPrefix": ""
},
"expireAt": 1605238559
}
获取的result直接反序列化,进行oss直传即可,extra host是访问地址
请求路径
POST 源自从policy接口获取的result字段"extra"中的"host"
请求参数
body
请求示例
curl --location --request POST 'https://content-store-version.oss-cn-qingdao.aliyuncs.com' \
--form 'OSSAccessKeyId=OSSACCESSKEYID' \
--form 'Signature=jVbcWO5v4Ujm7duQX+gqb0UBT2E=' \
--form 'policy=eyJjb25kaXRpb25zIjpbWyJzdGFydHMtd2l0aCIsIiRrZXkiLCJlNWEyN2FlOGI3NDM4N2NlMjA4YTI2YjVjMzBjZGI2MS9mNDhjOGY3ZC0xOGVmLTQ2OGEtYjA2ZS0yNzg5MzQ3MDVhNTMvLnNlZ21lbnQvZGF5VGVzdC9kYXlTZXF1ZW5jZTAxLy5zZWdtZW50X2VuZC8iXV0sImV4cGlyYXRpb24iOiIyMDIwLTEyLTE0VDA5OjAwOjI1WiJ9' \
--form 'key={objectPrefix}{checksum}' \
--form 'file=@/{localFile}'
返回结果
# 响应状态
HttpStatus 204
# 响应结果
返回为空
{}
上传完毕回调
请求路径
PUT /v1/datasets/{id}/callback
请求参数
Path
body
请求示例
curl --location --request PUT '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/callback' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"draftNumber": "1",
"remotePath": "car1.jpg",
"checksum": "b9676b075dff6d3333bbebb7cdd154f3631bb926",
"frameId": "01D78XYFJ1PRM1WPBCBT3VHMNV",
"segmentName": "car",
"sensorName": "camera_car",
"timestamp": 1532402934,
"label":{},
"fileSize": 10
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
上传完毕批量回调
请求路径
PUT /v1/datasets/{id}/multi/callback
请求参数
Path
body
请求示例
curl --location --request PUT '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/callback' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"draftNumber": "1",
"segmentName": "car",
"objects": [
{
"remotePath": "car1.jpg",
"checksum": "b9676b075dff6d3333bbebb7cdd154f3631bb926",
"frameId": "01D78XYFJ1PRM1WPBCBT3VHMNV",
"sensorName": "camera_car",
"timestamp": 1532402934,
"label":{},
"fileSize": 10
}
]
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
创建segment
POST /v1/datasets/{id}/segments
请求参数
Path
Query
Body
请求示例
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/segments'\
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"draftNumber":1,
"name": "graviti",
"description": "this is a segment"
}'
返回结果
# 响应状态
HttpStatus 201
# 响应结果
{}
删除Segment
DELETE /v1/datasets/{id}/segments
Path
Body
请求示例
curl --location --request DELETE '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/segments' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"draftNumber":1,
"segmentName": "car",
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
获取数据集segment
GET /v1/datasets/{id}/segments
请求参数
Path
Query
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/segments?commit=v1&offset=0&limit=2'\
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
{
"segments": [
{
"name": "car",
"description": "this is car"
},
{
"name": "graviti",
"description": "this is a segment"
}
],
"offset": 0,
"recordSize": 2,
"totalCount": 10
}
上传labelCatalog
PUT /v1/datasets/{id}/labels/catalogs
请求参数
Path
Body
请求示例
curl --location --request PUT '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/labels/catalogs'\
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"draftNumber": 1,
"BOX2D": {
"attributes": [
{
"description": "attribute 'traffic_light_color' is a multiple choice attribute",
"items": {
"enum": [
"unknown",
"red",
"yellow",
"green"
]
},
"name": "traffic_light_color",
"parentCategories": [
"traffic_light"
],
"type": "array"
},
{
"description": "attribute 'visibility' is a float value between 0 to 1",
"maximum": 1,
"minimum": 0,
"name": "visibility",
"type": "number"
},
{
"description": "this is color",
"enum": [
"red",
"blue",
"green"
],
"name": "color",
"parentCategories": [
"car"
],
"type": "string"
}
],
"categories": [
{
"description": "this is a car",
"name": "car"
}
],
"categoryDelimiter": ".",
"description": "this is a description of label catalog",
"isTracking": false
},
"BOX3D": {
"attributes": [
{
"description": "attribute 'traffic_light_color' is a multiple choice attribute",
"items": {
"enum": [
"unknown",
"red",
"yellow",
"green"
]
},
"name": "traffic_light_color",
"parentCategories": [
"traffic_light"
],
"type": "array"
},
{
"description": "attribute 'visibility' is a float value between 0 to 1",
"maximum": 1,
"minimum": 0,
"name": "visibility",
"type": "number"
},
{
"description": "this is color",
"enum": [
"red",
"blue",
"green"
],
"name": "color",
"parentCategories": [
"car"
],
"type": "string"
}
],
"categories": [
{
"description": "this is a car",
"name": "car"
}
],
"categoryDelimiter": ".",
"description": "this is a description of label catalog",
"isTracking": false
},
"CLASSIFICATION": {
"attributes": [
{
"description": "attribute 'traffic_light_color' is a multiple choice attribute",
"items": {
"enum": [
"unknown",
"red",
"yellow",
"green"
]
},
"name": "traffic_light_color",
"parentCategories": [
"traffic_light"
],
"type": "array"
},
{
"description": "attribute 'visibility' is a float value between 0 to 1",
"maximum": 1,
"minimum": 0,
"name": "visibility",
"type": "number"
},
{
"description": "this is color",
"enum": [
"red",
"blue",
"green"
],
"name": "color",
"parentCategories": [
"car"
],
"type": "string"
}
],
"categories": [
{
"description": "this is a car",
"name": "car"
}
],
"categoryDelimiter": ".",
"description": "this is a description of label catalog"
},
"CUBOID2D": {
"attributes": [
{
"description": "attribute 'traffic_light_color' is a multiple choice attribute",
"items": {
"enum": [
"unknown",
"red",
"yellow",
"green"
]
},
"name": "traffic_light_color",
"parentCategories": [
"traffic_light"
],
"type": "array"
},
{
"description": "attribute 'visibility' is a float value between 0 to 1",
"maximum": 1,
"minimum": 0,
"name": "visibility",
"type": "number"
},
{
"description": "this is color",
"enum": [
"red",
"blue",
"green"
],
"name": "color",
"parentCategories": [
"car"
],
"type": "string"
}
],
"categories": [
{
"description": "this is a car",
"name": "car"
}
],
"categoryDelimiter": ".",
"description": "this is a description of label catalog",
"isTracking": false
},
"KEYPOINTS2D": {
"attributes": [
{
"description": "attribute 'traffic_light_color' is a multiple choice attribute",
"items": {
"enum": [
"unknown",
"red",
"yellow",
"green"
]
},
"name": "traffic_light_color",
"parentCategories": [
"traffic_light"
],
"type": "array"
},
{
"description": "attribute 'visibility' is a float value between 0 to 1",
"maximum": 1,
"minimum": 0,
"name": "visibility",
"type": "number"
},
{
"description": "this is color",
"enum": [
"red",
"blue",
"green"
],
"name": "color",
"parentCategories": [
"car"
],
"type": "string"
}
],
"categories": [
{
"description": "this is a car",
"name": "car"
}
],
"categoryDelimiter": ".",
"description": "this is a description of label catalog",
"isTracking": false,
"keypoints": [
{
"description": "this is key point",
"names": [
"ear",
"leg",
"mouse"
],
"number": 3,
"parentCategories": [],
"skeleton": [
[
0,
1
],
[
1,
2
]
],
"visible": "1"
}
]
},
"POLYGON2D": {
"attributes": [
{
"description": "attribute 'traffic_light_color' is a multiple choice attribute",
"items": {
"enum": [
"unknown",
"red",
"yellow",
"green"
]
},
"name": "traffic_light_color",
"parentCategories": [
"traffic_light"
],
"type": "array"
},
{
"description": "attribute 'visibility' is a float value between 0 to 1",
"maximum": 1,
"minimum": 0,
"name": "visibility",
"type": "number"
},
{
"description": "this is color",
"enum": [
"red",
"blue",
"green"
],
"name": "color",
"parentCategories": [
"car"
],
"type": "string"
}
],
"categories": [
{
"description": "this is a car",
"name": "car"
}
],
"categoryDelimiter": ".",
"description": "this is a description of label catalog",
"isTracking": false
},
"POLYLINE2D": {
"attributes": [
{
"description": "attribute 'traffic_light_color' is a multiple choice attribute",
"items": {
"enum": [
"unknown",
"red",
"yellow",
"green"
]
},
"name": "traffic_light_color",
"parentCategories": [
"traffic_light"
],
"type": "array"
},
{
"description": "attribute 'visibility' is a float value between 0 to 1",
"maximum": 1,
"minimum": 0,
"name": "visibility",
"type": "number"
},
{
"description": "this is color",
"enum": [
"red",
"blue",
"green"
],
"name": "color",
"parentCategories": [
"car"
],
"type": "string"
}
],
"categories": [
{
"description": "this is a car",
"name": "car"
}
],
"categoryDelimiter": ".",
"description": "this is a description of label catalog",
"isTracking": false
},
"SENTENCE": {
"attributes": [
{
"description": "this is a description of attribute",
"enum": [
"red",
"blue",
"green"
],
"items": {
"enum": [
"red",
"blue",
"green"
],
"maximum": 10,
"minimum": 0,
"type": {}
},
"maximum": 10,
"minimum": 0,
"name": "color",
"parentCategories": [],
"type": {}
}
],
"description": "this is a description of label catalog",
"isSample": false,
"lexicon": "[[\"啊\", \"aa\", \"a1\"], [\"阿婆\": \"aa\", \"a1\", \"p\", \"o2\"], [\"爱\", \"aa\", \"ai4\"], [\"爱祖国\",\"aa\", \"ai4\", \"z\", \"u3\", \"g\", \"uo2\"]]",
"sampleRate": 32
}
}'
返回结果
HttpStatus 200
{}
获取数据集标签目录
GET /v1/datasets/{id}/labels/catalogs
请求参数
Path
Query
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/labels/catalogs?commit=v1'\
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"catalog": {
"BOX2D": {
"attributes": [
{
"name": "color"
}
],
"categories": [
{
"description": "hello",
"name": "car"
}
]
}
}
}
上传sensor
POST /v1/datasets/{id}/sensors
Path
Body
请求示例
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/sensors' \
--header 'x-token: {your_accesskey}' \