Data Operation
UploadData
Upload data to a dataset
Users upload data to a dataset
Acquire data upload credentials
Transfer data directly to S3
Put callback
GetPolicy
Acquire upload credentials
Request path
GET /v1/datasets/{id}/policies
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Query
Name
Type
Descriptions
Value
draftNumber
int
Yes
Draft number
segmentName
string
No
Dataset segmentation
expired
int
No
The token expiration time measured in seconds cannot be negative. The default is 60 seconds and any time greater than 300 seconds will be treated as 300
Request instance
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/policies?expired=60&draftNumber=1' \
--header 'x-token: {your_accesskey}'\
--header 'Content-Type: application/json'
Output
# Response status
HttpStatus 200
# Response result
{
"result": {
"policy": "eyJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJmYXQtZGF0YXBsYXRmb3JtLXZlcnNpb24ifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsIjNhZTBiYzI5M2Q3N2FiYjQwODZhMzc5ZjAyNjkwNmNlL2YwODk3NDUwLWNlZjEtNGQ3Zi05NDI3LWNiZGRhZjcxYzc1YS8iXSxbInN0YXJ0cy13aXRoIiwiJHN1Y2Nlc3NfYWN0aW9uX3N0YXR1cyIsIiJdLFsic3RhcnRzLXdpdGgiLCIkQ29udGVudC1UeXBlIiwiIl0seyJ4LWFtei1jcmVkZW50aWFsIjoiQUtJQVFIVFdDQTNKTTZESTdVQ0YvMjAyMTAzMjQvdXMtd2VzdC0xL3MzL2F3czRfcmVxdWVzdCJ9LHsieC1hbXotYWxnb3JpdGhtIjoiQVdTNC1ITUFDLVNIQTI1NiJ9LHsieC1hbXotZGF0ZSI6IjIwMjEwMzI0VDA1NDIwMFoifV0sImV4cGlyYXRpb24iOiIyMDIxLTAzLTI0VDA1OjQ0OjAwWiJ9",
"success_action_status": "200",
"x-amz-algorithm": "AWS4-HMAC-SHA256",
"x-amz-credential": "AKIAQHTWCA3JM6DI7UCF/20210324/us-west-1/s3/aws4_request",
"x-amz-date": "20210324T054200Z",
"x-amz-signature": "8dbc309fa36caad5791907c385632e74a47362ca6f1517b748e150f1306851a0"
},
"extra": {
"backendType": "s3",
"host": "https://dataplatform-version.s3.us-west-1.amazonaws.com",
},
"expireAt": 1616564580
}
Front-end direct transmission based on the acquired credentials
The obtained result can be deserialized directly and transferred directly to S3. extra host is the access address
Request path
POST The value of "host" within the "extra" array from the output above
Request parameter
body
Name
Type
Required
Descriptions
x-amz-credential
string
Yes
Consistent with the returned x-amz-credential of the previously obtained credentials
success_action_status
string
Yes
Consistent with the return value success_action_status of the previously obtained credentials
x-amz-algorithm
string
Yes
Consistent with the returned x-amz-algorithm of the previously obtained credentials
x-amz-signature
string
Yes
Consistent with the return value x-amz-signature of the previously obtained credentials
policy
string
Yes
Consistent with the returned policy of the previously obtained credentials
x-amz-date
string
Yes
Consistent with the return value x-amz-date of the previously obtained credentials
key
string
Yes
Calculate the checksum of a file with SHA-1 cryptographic hash
file
file
Yes
File
Request instance
curl --location --request POST 'https://dataplatform-version.s3.us-west-1.amazonaws.com/' \
--form 'x-amz-credential=AKIAQHTWCA3JM6DI7UCF/20210323/us-west-1/s3/aws4_request' \
--form 'x-amz-algorithm=AWS4-HMAC-SHA256' \
--form 'x-amz-date=20210323T120601Z' \
--form 'x-amz-signature=42d7455003455a76796d67087b6a314b6c28445a14b80c9145029aeaa0091ec4' \
--form 'policy=eyJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJmYXQtZGF0YXBsYXRmb3JtLXZlcnNpb24ifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsIjNhZTBiYzI5M2Q3N2FiYjQwODZhMzc5ZjAyNjkwNmNlL2YwODk3NDUwLWNlZjEtNGQ3Zi05NDI3LWNiZGRhZjcxYzc1YS8iXSxbInN0YXJ0cy13aXRoIiwiJHN1Y2Nlc3NfYWN0aW9uX3N0YXR1cyIsIiJdLFsic3RhcnRzLXdpdGgiLCIkQ29udGVudC1UeXBlIiwiIl0seyJ4LWFtei1jcmVkZW50aWFsIjoiQUtJQVFIVFdDQTNKTTZESTdVQ0YvMjAyMTAzMjMvdXMtd2VzdC0xL3MzL2F3czRfcmVxdWVzdCJ9LHsieC1hbXotYWxnb3JpdGhtIjoiQVdTNC1ITUFDLVNIQTI1NiJ9LHsieC1hbXotZGF0ZSI6IjIwMjEwMzIzVDEyMDYwMVoifV0sImV4cGlyYXRpb24iOiIyMDIxLTAzLTIzVDEyOjA4OjAxWiJ9' \
--form 'success_action_status=200' \
--form 'key=b9676b075dff6d3333bbebb7cdd154f3631bb926' \
--form 'file=@/{localFile}'
Output
# Response status
HttpStatus 204
# Response result
{}
PutCallback
Upload complete callback
Request path
PUT /v1/datasets/{id}/callback
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
body
Name
Type
Required
Descriptions
draftNumber
int
Yes
Draft number
checksum
string
Yes
The checksum of an uploaded file. Calculate the checksum of a file with SHA-1 cryptographic hash
remotePath
string
Yes
The remote file path, such as a.jpg
segmentName
string
Yes
Segment name
sensorName
string
No
Must be passed for the upload of fusion data; sensor name
frameId
string
No
Must be provided for the upload of fusion data. The frameID should be in the format of ulid. Please refer to https://github.com/oklog/ulid
timestamp
float
No
Not required to be provided for Fusion data upload
label
map
No
For the annotation labels of the file, please refer to uploadLabel
Request instance
curl --location --request PUT '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/callback' \
--header 'x-token: {your_accesskey}'\
--header 'Content-Type: application/json'\
--data-raw '{
"draftNumber": "1",
"checksum": "b9676b075dff6d3333bbebb7cdd154f3631bb926",
"remotePath": "car1.jpg",
"frameId": "01D78XYFJ1PRM1WPBCBT3VHMNV",
"segmentName": "car",
"sensorName": "camera_car",
"timestamp": 1532402934
}'
Output
# Response status
HttpStatus 200
# Response result
{}
MultiPutCallback
Batch callback
Request path
PUT /v1/datasets/{id}/multi/callback
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
body
Name
Type
Required
Descriptions
draftNumber
int
Yes
Draft number
segmentName
string
Yes
Segment name
objects
[]object
Yes
The batch callback objects
├─checksum
string
Yes
The checksum of an uploaded file. Calculate the checksum of a file with SHA-1 cryptographic hash
├─remotePath
string
Yes
The remote file path, such as a.jpg
├─sensorName
string
No
Must be passed for the upload of fusion data; sensor name
├─frameId
string
No
Must be provided for the upload of fusion data. The frameID should be in the format of ulid. Please refer to https://github.com/oklog/ulid
├─timestamp
float
No
Not required to be provided for Fusion data upload
├─label
map
No
For the annotation labels of the file, please refer to uploadLabel
Request instance
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":{}
}
]
}'
Output
# Response status
HttpStatus 200
# Response result
{}
createSegment
Create a segment
POST /v1/datasets/{id}/segments
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Body
Name
Type
Required
Descriptions
draftNumber
int
Yes
Draft number
name
string
Yes
Segment name. This cannot be null and should not include ".",""
description
string
No
Segment description
Request instance
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"
}'
Output
# Response status
HttpStatus 201
# Response result
{}
DeleteSegment
Delete segment
DELETE /v1/datasets/{id}/segments
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Body
Name
Type
Required
Descriptions
draftNumber
int
Yes
Draft number
segmentName
string
Yes
segmentName
Request instance
curl --location --request DELETE '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/segments' \
--header 'x-token: {your_accesskey}'\
--data-raw '{
"draftNumber":1,
"segmentName": "car",
}'
Output
# Response status
HttpStatus 200
# Response result
{}
ListSegment
Acquire dataset segment
GET /v1/datasets/{id}/segments
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Query
Name
Type
Required
Descriptions
draftNumber
int
No
Draft number. Only one of draft and commit should exist, but they should not exist at the same time
commit
string
No
Commit ID, commit tag, or branch name
limit
int
No
The default is set to 128. The maximum value for a single time is 128
offset
int
No
The default is 0
sortBy
string
No
Currently sorting is based or created_at and updated_at while entering other content will return InvalidParamsValue.
orderBy
string
No
The default is desc (descending order). The valid content is asc (ascending order) and desc
Request instance
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/segments?commit=v1.0&offset=0&limit=2'\
--header 'x-token: {your_accesskey}'\
--header 'Content-Type: application/json'
Output
Normal dataset
# Response status
HttpStatus 200
{
"segments": [
{
"name": "car",
"description": "this is car"
},
{
"name": "graviti",
"description": "this is a segment"
}
],
"offset": 0,
"recordSize": 2,
"totalCount": 10
}
UploadLabelCatalog
Upload the labelCatalog
PUT /v1/datasets/{id}/labels/catalogs
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Body
Name
Type
Required
Descriptions
draftNumber
int
Yes
Draft number
catalog
map
yes
Annotation Type. key: CLASSIFICATION: annotation classification BOX2D: 2D box annotation BOX3D: 3D box annotation POLYGON2D: 2D polygon annotation POLYLINE2D: 2D polyline annotation KEYPOINTS2D: 2D keypoints annotation CUBOID2D: 2D cuboid annotation SENTENCE: audio transcription annotation For the annotation type above, each one of them has its own structure. You can refer to the request instances for detailed information. Please follow the format of the input value for each annotation type
├─description
string
false
Descriptions
├─categoryDelimiter
string
false
The delimiter used to separate the parent-child relationship of category. The default is not to support the parent-child relationship. The recommended delimiter is "."
├─categories
object[]
false
Item type: object and category list, which includes all category information
├─isTracking
bool
No
Tracking or not
├─name
string
yes
Category name
├─description
string
No
Category description
├─attributes
object[]
No
Item type. It includes attribute-related information
├─name
string
Yes
Attribute name
├─type
string/string[]
false
attribute type:string, boolean, integer, number, array, null,such as"interger", ["integer", "null"]
├─minimum
float
No
The minimum value of the attribute. When the attribute is numerical, this field defines the minimum value (closed interval)
├─maximum
float
No
The maximum value of the attribute. When the attribute is numerical, this field defines the maximum value (closed interval)
├─description
string
No
Attribute description
├─enum
string[]
No
The options of the value of an attribute. This represents all the possible options this attribute may have.
├─parentCategories
string[]
No
Relational categories represent the categories to which the attribute belongs to. If it is empty, then this is a global attribute
├─items
object[]
No
Item type that defines multiple attributes. (When the "type" field is "array", it indicates multiple attributes)
├─type
string/string[]
No
type of an attribute value with multiple options:string, boolean, integer, number, array, null,such as "interger", ["integer", "null"]
├─minimum
float
No
The minimum value (closed interval) of the attribute value with multiple options
├─maximum
float
No
The maximum value (closed interval) of the multiple attribute
├─enum
string[]
No
The enumeration of the value of an attribute with multiple options. This represents all the possible options this attribute may have.
Request instance
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
}
}'
Output
HttpStatus 200
{}
GetLabelCatalog
Acquire dataset label
GET /v1/datasets/{id}/labels/catalogs
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Query
Name
Type
Required
Descriptions
draftNumber
int
No
Draft number. Only one of draft and commit should exist, but they should not exist at the same time
commit
string
false
Commit ID, commit tag, or branch name
Request instance
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/labels/catalogs?commit=v1.0'\
--header 'x-token: {your_accesskey}'\
--header 'Content-Type: application/json'
Output
# Response status
HttpStatus 200
# Response result
{
"catalog": {
"BOX2D": {
"attributes": [
{
"name": "color"
}
],
"categories": [
{
"description": "hello",
"name": "car"
}
]
}
}
}
UploadSensor
Upload sensor
POST /v1/datasets/{id}/sensors
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Body
Name
Type
Required
Descriptions
draftNumber
int
是
Draft number
segmentName
string
Yes
Segment Name
name
string
Yes
Sensor name
type
string
Yes
Sensor type
description
string
No
Descriptions
extrinsics
object
No
The extrinsics of sensor
├─rotation
object
No
Rotation matrix
├─w
float
Yes
w
├─x
float
Yes
x
├─y
float
Yes
y
├─z
float
Yes
z
├─translation
object
No
Translation matrix
├─x
float
Yes
x
├─y
float
Yes
y
├─z
float
Yes
z
intrinsics
object
No
The intrinsics of sensor (required only for camera-like devices)
├─cameraMatrix
object
No
├─cx
float
Yes
├─cy
float
Yes
cy
├─fx
float
Yes
fx
├─fy
float
Yes
fy
├─skew
float
No
skew
├─distortionCoefficients
object
No
Distortion coefficients (p1, p2, k1, k2, k3, k4, k5, k6 and so on. The more coefficients are provided, the more accurate the calculation) ├─p1|float|No|p1 ├─p2|float|No|p2 ├─k1|float|No|k1 ├─k2|float|No|k2 ├─k3|float|No|k3
Request instance
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/sensors' \
--header 'x-token: {your_accesskey}'\
--data-raw '{
"description": "This is a example camera sensor",
"extrinsics": {
"rotation": {
"w": 0.6924185592174665,
"x": -0.7031619420114925,
"y": -0.11648342771943819,
"z": 0.11203317912370753
},
"translation": {
"x": 1.03569100218,
"y": 0.484795032713,
"z": 1.59097014818
}
},
"intrinsics": {
"cameraMatrix": {
"cx": 1256.7414812095406,
"cy": 492.7757465151356,
"fx": 1256.7414812095406,
"fy": 792.1125740759628,
"skew": 122.7757465151356
},
"distortionCoefficients": {
"k1": 0.12,
"k2": 0.33,
"k3": 0.13,
"k4": 0.93,
"k5": 0.23,
"p1": 1,
"p2": 0.3
}
},
"name": "camera_01",
"segmentName": "car",
"type": "CAMERA"
}'
DeleteSensor
Delete sensor
DELETE /v1/datasets/{id}/sensors
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Body
Name
Type
Required
Descriptions
draftNumber
int
Yes
Draft number
segmentName
string
Yes
Segment name
sensorName
string
Yes
Sensor name
Request instance
curl --location --request DELETE '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/sensors' \
--header 'x-token: {your_accesskey}'\
--data-raw '{
"draftNumber": 1,
"segmentName": "car",
"name": "sensor1",
}'
Output
# Response status
HttpStatus 200
# Response result
{}
ListSensor
Acquire the sensor
GET /v1/datasets/{id}/sensors
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Query
Name
Type
Required
Descriptions
draftNumber
int
No
Draft number. Only one of draft and commit should exist, but they should not exist at the same time
commit
string
No
The tag of commitId or commit
segmentName
string
Yes
Segment name
Request instance
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/sensors?segmentName=car&commit=v1.0' \
--header 'x-token: {your_accesskey}'
Output
# Response status
HttpStatus 200
# Response result
{
"segmentName": "car",
"sensors": [
{
"name": "sensor1",
"type": "camera",
"extrinsics": {
"rotation": {
"w": 1.1,
"x": 1.2,
"y": 1.3,
"z": 1.4
},
"translation": {
"x": 1.2,
"y": 1.3,
"z": 1.4
}
},
"intrinsics": {
"cameraMatrix": {
"cx": 1.1,
"cy": 1.2,
"fx": 1.1,
"fy": 1.2,
"skew": 1.3
},
"distortionCoefficient": {
"k1": 1.4,
"k2": 1.5,
"k3": 1.6,
"k4": 1.7,
"k5": 1.8,
"k6": 1.9,
"p1": 1.2,
"p2": 1.3
}
},
"description": "this is a sensor"
},
{
"name": "sensor2",
"type": "camera",
"extrinsics": {
"rotation": {
"w": 1.1,
"x": 1.2,
"y": 1.3,
"z": 1.4
},
"translation": {
"x": 1.2,
"y": 1.3,
"z": 1.4
}
},
"intrinsics": {
"cameraMatrix": {
"cx": 1.1,
"cy": 1.2,
"fx": 1.1,
"fy": 1.2,
"skew": 1.3
},
"distortionCoefficient": {
"k1": 1.4,
"k2": 1.5,
"k3": 1.6,
"k4": 1.7,
"k5": 1.8,
"k6": 1.9,
"p1": 1.2,
"p2": 1.3
}
},
"description": "this is a sensor"
}
]
}
ListData
List data
GET /v1/datasets/{id}/data
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Query
Name
Type
Required
Descriptions
draftNumber
int
No
Draft number. Only one of draft and commit should exist, but they should not exist at the same time
commit
string
No
Commit ID, commit tag, or branch name
segmentName
string
Yes
Segment name
limit
int
No
The default is set to 128. The maximum value for a single time is 128
offset
int
No
The default is 0
sortBy
string
No
Currently sorting is based on created_at and updated_at while entering other content will return InvalidParamsValue.
orderBy
string
No
The default is desc (descending order). The valid content is asc (ascending order) and desc
Request instance
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/data?draftNumber=1&segmentName=car'\
--header 'x-token: {your_accesskey}'\
--header 'Content-Type: application/json'
Output
Normal datasets
{
"segmentName": "car",
"type": 0,
"data": [{"remotePath": "car.jpg."}],
"offset": 0,
"recordSize": 1,
"totalCount": 1
}
Fusion datasets
{
"segmentName": "car",
"type": 1,
"data": [
{
"frameId": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"frameIndex": 1,
"frame": [
{
"sensorname": "camera_car",
"remotePath": "fusion_data_car3.jpg",
"timestamp":1609430401,
}
]
}
],
"offset": 0,
"recordSize": 1,
"totalCount": 1
}
ListDataUri
Acquire the data resource address
GET /v1/datasets/{id}/data/urls
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Query
Name
Type
Required
Descriptions
draftNumber
int
No
Draft number. Only one of draft and commit should exist, but they should not exist at the same time
commit
string
No
Commit ID, commit tag, or branch name
remotePath
string
No
The data path. If you want to pass a value, search for the specific URL of this data
segmentName
string
Yes
Segment name
limit
int
No
The default is set to 128. The maximum value for a single time is 128
offset
int
No
The default is 0
sortBy
string
No
Currently sorting is based on the name (remotePath) and supports created_at and updated_at while entering other contents would return InvalidParamsValue
orderBy
string
No
The default is desc (descending order). The valid content is asc (ascending order) and desc
Request instance
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/data/urls?draftNumber=1&remotePath=graviti.jpg&segmentName=car' \
--header 'x-token: {your_accesskey}'
Output
# Response status
HttpStatus 200
# Response result
{
"offset": 0,
"recordSize": 5,
"totalCount": 5,
"segmentName": "car",
"urls": [
{
"remotePath": "00000010.jpg",
"url": "https://dataplatform-version.s3.us-west-1.amazonaws.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00000010.jpg?Expires=1611304780&OSSAccessKeyId=LTAI4FjgXD3yFJUat4KADigE&Signature=DJbZOXSF1FSBQT4wEv69O%2B3OhyI%3D&versionId=CAEQPRiBgMD1o.mEshciIDk4ZmZkMWM2NmQ5ZTQ1NWRhNTBmZDZjNzJjNjM4OGRl"
},
{
"remotePath": "00040820.jpg",
"url": "https://dataplatform-version.s3.us-west-1.amazonaws.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00040820.jpg?Expires=1611304780&OSSAccessKeyId=LTAI4FjgXD3yFJUat4KADigE&Signature=DihdFjHDtE3xEyIx3eGbTmN%2B%2Bzc%3D&versionId=CAEQPRiBgMD_pOmEshciIGFjYjVjY2FjYmZkMzRjYjVhZTQ5ZjQxZWMwMzhkOTMx"
},
{
"remotePath": "00040890.jpg",
"url": "https://dataplatform-version.s3.us-west-1.amazonaws.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00040890.jpg?Expires=1611304780&OSSAccessKeyId=LTAI4FjgXD3yFJUat4KADigE&Signature=pwhm9liDx9%2BbDp2VlPghd1Kw0as%3D&versionId=CAEQPRiBgMD0pemEshciIGExZDdlOTBjMmQxMDQxMmFiM2QxMTAzNmU3N2I5ODFk"
},
{
"remotePath": "00040900.jpg",
"url": "https://dataplatform-version.s3.us-west-1.amazonaws.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00040900.jpg?Expires=1611304780&OSSAccessKeyId=LTAI4FjgXD3yFJUat4KADigE&Signature=GpvY%2BJqbX7qKA70E7t58bRVn%2FcI%3D&versionId=CAEQPRiBgMC9p.mEshciIGY2YzIzNGZmM2EyZDQwMzZiODc4MzNmMmVlY2E0MTAy"
},
{
"remotePath": "00040940.jpg",
"url": "https://dataplatform-version.s3.us-west-1.amazonaws.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00040940.jpg?Expires=1611304780&OSSAccessKeyId=LTAI4FjgXD3yFJUat4KADigE&Signature=TguAbiIM0pjWFse1S0MQRUbMuBg%3D&versionId=CAEQPRiBgIDLqemEshciIGM2YmRkZGJlNmY2OTQ5NmViNTEzMDg0NjFmNjczNmYw"
}
]
}
UploadLabel
Upload labels
PUT /v1/datasets/{id}/labels
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Body
Name
Type
Required
Descriptions
draftNumber
int
Yes
Draft number
segmentName
string
Yes
Segment name
remotePath
string
Yes
The corresponding resources
label
map
Yes
Label. key: CLASSIFICATION: annotation classification BOX2D:2D box annotation BOX3D: 3D box annotation POLYGON2D: 2D polygon annotation POLYLINE2D: 2D polyline annotation KEYPOINTS2D: 2D keypoints annotation CUBOID2D: 2D cuboid annotation SENTENCE: audio transcription annotation Please refer to the request instances for the corresponding value content format for each key. Please follow the format of the input parameters for each annotation type.
Request instance
curl --location --request PUT '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/labels' \
--header 'x-token: {your_accesskey}'\
--data-raw '{
"remotePath": "car1.jpg",
"segmentName": "car",
"draftNumber": 1,
"label": {
"BOX2D": [
{
"attributes": {
"color": "blue"
},
"box2d": {
"xmax": 10,
"xmin": 1,
"ymax": 18,
"ymin": 6
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5"
}
],
"BOX3D": [
{
"attributes": {
"color": "blue"
},
"box3d": {
"rotation": {
"w": 1,
"x": 1.1,
"y": 1.2,
"z": 1.3
},
"size": {
"x": 1.1,
"y": 1.2,
"z": 1.3
},
"translation": {
"x": 1.1,
"y": 1.2,
"z": 1.3
}
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5"
}
],
"CLASSIFICATION": {
"attributes": {
"color": "blue"
},
"category": "car"
},
"CUBOID2D": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"cuboid2d": {
"back": [
{
"x": 1,
"y": 2
},
{
"x": 1.1,
"y": 2.1
},
{
"x": 1.2,
"y": 2.2
},
{
"x": 1.3,
"y": 2.3
}
],
"front": [
{
"x": 1,
"y": 2
},
{
"x": 1.1,
"y": 2.1
},
{
"x": 1.2,
"y": 2.2
},
{
"x": 1.3,
"y": 2.3
}
]
},
"instance": "400a7ec7faa643e38e7ab220463bc4b5"
}
],
"KEYPOINTS2D": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5",
"keypoints2d": [
{
"v": 1.3,
"x": 1.1,
"y": 1.2
}
]
}
],
"POLYGON2D": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5",
"polygon2d": [
{
"x": 1.1,
"y": 1.2
}
]
}
],
"POLYLINE2D": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5",
"polyline2d": [
{
"x": 1.1,
"y": 1.2
}
]
}
],
"SENTENCE": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5",
"phone": [
{
"begin": "b",
"end": "e",
"text": "hello"
}
],
"sentence": [
{
"begin": "b",
"end": "e",
"text": "hello"
}
],
"spell": [
{
"begin": "b",
"end": "e",
"text": "hello"
}
]
}
]
}
}'
Output
# Response status
HttpStatus 200
# Response result
{}
ListLabel
Acquire dataset label
GET /v1/datasets/{id}/labels
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Query
Name
Type
Required
Descriptions
draftNumber
int
No
Draft number. Only one of draft and commit should exist, but they should not exist at the same time
commit
string
No
Commit ID, commit tag, or branch name
limit
int
No
The default is set to 128. The maximum value for a single time is 128
offset
int
No
The default is 0
segmentName
string
Yes
Segment name
sortBy
string
No
Currently sorting is based on created_at and updated_at while entering other content will return InvalidParamsValue.
orderBy
string
No
The default is desc (descending order). The valid content is asc (ascending order) and desc
Request instance
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/labels?draftNumber=1&offset=0&limit=1&segmentName=car'\
--header 'x-token: {your_accesskey}'\
--header 'Content-Type: application/json'
Output
Normal dataset
# Response status
HttpStatus 200
{
"segmentName": "",
"type": 0,
"labels": [
{
"remotePath": "data_car.jpg",
"label": {
}
}
],
"offset": 0,
"recordSize": 1,
"totalCount": 1
}
Fusion datasets
# Response status
HttpStatus 200
{
"segmentName": ""
"type": 1,
"labels": [
{
"frameId": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"order": 1,
"frame": [
{
"sensorName": "camera_car",
"remotePath": "fusion_data_car2.jpg",
"timestamp":1609430400,
"label": {
}
},
{
"sensorname": "camera_car",
"remotePath": "fusion_data_car3.jpg",
"timestamp":1609430401,
"label": {
}
}
]
}
],
"offset": 0,
"recordSize": 1,
"totalCount": 1
}
DeleteData
Delete Data
DELETE /v1/datasets/{id}/data
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Body
Name
Type
Required
Descriptions
draftNumber
int
Yes
Draft number
segmentName
string
Yes
Segment name
remotePaths
string[]
Yes
The list of remote paths that needs to be deleted. The number of the list should not be greater than 128
Request instance
curl --location --request DELETE '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/segments' \
--header 'x-token: {your_accesskey}'\
--data-raw '{
"draftNumber": 1,
"segmentName": "test",
"remotePaths": ["car1.jpg"]
}'
Output
# Response status
HttpStatus 200
# Response result
{}
Last updated
Was this helpful?