帮助文档
搜索文档…
⌃K

Data Operation

UploadData

上传数据到数据集
用户往数据集中上传数据。
  1. 1.
    获取上传数据凭证
  2. 2.
    直传数据到oss

GetPolicy

获取上传凭证
请求路径
GET /v1/datasets/{id}/policies
请求参数
Path
名称
是否必须
描述
id
数据集ID
Query
名称
类型
是否必须
描述
draftNumber
int
草稿编号
segmentName
string
数据集分割区
isInternal
bool
是否返回内网上传地址
expired
int
令牌过期时间,以秒为单位,不可为负,默认60, 大于300会按照300处理
请求示例
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
名称
类型
是否必须
描述
OSSAccessKeyId
string
与之前获取的凭证返回值OSSAccessKeyId一致
Signature
string
与之前获取的凭证返回值Signature一致
policy
string
与之前的获取凭证返回的policy一致
key
string
之前的获取凭证返回的objectPrefix + 计算文件的cheksum值。用sha1加密算法获取文件checksum值
file
file
文件
请求示例
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 '[email protected]/{localFile}'
返回结果
# 响应状态
HttpStatus 204
# 响应结果
返回为空
{}

PutCallback

上传完毕回调
请求路径
PUT /v1/datasets/{id}/callback
请求参数
Path
名称
是否必须
描述
id
数据集ID
body
名称
类型
是否必须
描述
draftNumber
int
草稿编号
checksum
string
上传的文件的checksum,用sha1加密算法获取文件checksum值
segmentName
string
segment 名称
remotePath
string
远程的文件路径,例如a.jpg
sensorName
string
融合类数据上传必传,传感器名称
frameId
string
融合类数据上传必传,帧id, ulid格式,参考 https://github.com/oklog/ulid
timestamp
float
融合类数据上传非必传
label
map
该文件的标注标签信息,具体可参考uploadLabel
fileSize
int
文件大小, 若未传,服务端将计算文件大小
请求示例
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
# 响应结果
{}

MultiPutCallback

上传完毕批量回调
请求路径
PUT /v1/datasets/{id}/multi/callback
请求参数
Path
名称
是否必须
描述
id
数据集ID
body
名称
类型
是否必须
描述
draftNumber
int
草稿编号
segmentName
string
segment 名称
objects
[]object
批量回调的object
├─checksum
string
上传的文件的checksum,用sha1加密算法获取文件checksum值
├─remotePath
string
远程的文件路径,例如a.jpg
├─sensorName
string
融合类数据上传必传,传感器名称
├─frameId
string
融合类数据上传必传,帧id, ulid格式,参考 https://github.com/oklog/ulid
├─timestamp
float
融合类数据上传非必传
├─label
map
该文件的标注标签信息,具体可参考uploadLabel
├─fileSize
int
文件大小, 若未传,服务端将计算文件大小
请求示例
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
# 响应结果
{}

CreateSegment

创建segment
POST /v1/datasets/{id}/segments
请求参数
Path
名称
是否必须
描述
id
数据集ID
Query
名称
类型
是否必须
描述
move
bool
从已有剪切创建
copy
bool
从已有复制创建
multipleMove
bool
从多个已有剪切创建
multipleCopy
bool
从多个已有复制创建
Body
名称
类型
是否必须
描述
draftNumber
int
草稿编号
name
string
segment 名称, 当不是用已有操作时 不可为null,name中不可包含".","\"
description
string
segment 描述
strategy
string
当不是用已有操作时移动重名时的策略,可选项有:abort,override 和 skip,缺省为 abort
segmentName
string
目标数据分段名, 从已有单个创建时使用
segmentNames
string[]
目标数据分段名, 从已有多个创建时使用
source
object
来源数据分段, 从已有单个创建时使用且必须
├─ segmentName
string
分区名
├─ id
string
数据集id
├─ draftNumber
int
草稿编号
├─ commit
string
commitId或者commit的tag
source
object
来源数据分段, 从已有多个创建时使用且必须
├─ segmentName
string[]
分区名 列表
├─ id
string
数据集id
├─ draftNumber
int
草稿编号
├─ commit
string
commitId或者commit的tag
请求示例
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
# 响应结果
{}

DeleteSegment

删除Segment
DELETE /v1/datasets/{id}/segments
Path
名称
是否必须
描述
id
数据集ID
Body
名称
类型
是否必须
描述
draftNumber
int
草稿编号
segmentName
string
segment 名称
请求示例
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
# 响应结果
{}

ListSegment

获取数据集segment
GET /v1/datasets/{id}/segments
请求参数
Path
名称
是否必须
描述
id
数据集ID
Query
名称
类型
是否必须
描述
draftNumber
int
草稿编号,draft和commit二者必须存在一个,但不可全部存在
commit
string
commit id 或者 commit tag 或者 branch name
limit
int
默认128,单次最多128
offset
int
默认0
sortBy
string
排序的字段,默认update_at(更新时间), 目前支持create_at(创建时间)和update_at,传入其他内容会返回InvalidParamsValue
orderBy
string
默认desc(倒序),合法内容为asc(顺序)和desc
请求示例
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
}

UploadLabelCatalog

上传labelCatalog
PUT /v1/datasets/{id}/labels/catalogs
请求参数
Path
名称
是否必须
描述
id
数据集ID
Body
名称
类型
是否必须
描述
draftNumber
int
草稿编号
catalog
map
标注类型。 key: CLASSIFICATION: 分类标注 BOX2D: 2D 框标注 BOX3D: 3D 框标注 POLYGON2D: 2D 多边形标注 POLYLINE2D: 2D 折线标注 KEYPOINTS2D: 2D 关键点标注 CUBOID2D: 2D 立体框标注 SENTENCE: 语音转写标注 以上标注类型,每类标注类型都有自己的结构,具体可看示例或参考标签格式,请严格遵循该标注类型格式传值
├─description
string
描述
├─categoryDelimiter
string
用于分割category父子关系的分割符,缺省为不支持父子关系,推荐分隔符为"."
├─isTracking
bool
是否是追踪
├─categories
object[]
item 类型: object,category 列表,包含所有 category 信息
├─name
string
category 名称
├─description
string
category 描述
├─attributes
object[]
item 类型,包含属性相关信息
├─name
string
attribute 名称
├─type
string/string[]
attribute type:string, boolean, integer, number, array, null,例如"interger", ["integer", "null"]
├─minimum
float
属性值最小值,当属性为数字时该字段定义了其最小值(闭区间)
├─maximum
float
属性值最大值,当属性为数字时该字段定义了其最大值(闭区间)
├─description
string
属性描述
├─enum
string[]
属性值选项,表示该属性所有的可能的选项
├─parentCategories
string[]
关联类别,表示该属性隶属于哪些类别,为空则表示全局属性
├─items
object[]
item类型,多选属性定义,(当"type"字段为"array"时,表示多选属性)
├─type
string/string[]
多选属性值类型:string, boolean, integer, number, array, null,例如"interger", ["integer", "null"]
├─minimum
float
多选属性值最小值(闭区间)
├─maximum
float
多选属性值最大值(闭区间)
├─enum
string[]
多选属性值选项,表示该属性所有的可能的选项
请求示例
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
{}

GetLabelCatalog

获取数据集标签目录
GET /v1/datasets/{id}/labels/catalogs
请求参数
Path
名称
是否必须
描述
id
数据集ID
Query
名称
类型
是否必须
描述
draftNumber
int
草稿编号,draft和commit二者必须存在一个,但不可全部存在
commit
string
commit id 或者 commit tag 或者 branch name
请求示例
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"
}
]
}
}
}

UploadSensor

上传sensor
POST /v1/datasets/{id}/sensors
Path
名称
是否必须
描述
id
数据集ID
Body
名称
类型
是否必须
描述
draftNumber
int
草稿编号
segmentName
string
segment 名称
name
string
sensor 名称
type
string
sensor 类型
description
string
描述
extrinsics
object
sensor 外参
├─rotation
object
旋转矩阵
├─w
float
w
├─x
float
x
├─y
float
y
├─z
float
z
├─translation
object
平移矩阵
├─x
float
x
├─y
float
y
├─z
float