Data Operation

UploadData

上传数据到数据集

用户往数据集中上传数据。

  1. 获取上传数据凭证

  2. 直传数据到oss

GetPolicy

获取上传凭证

请求路径

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
# 响应结果
返回为空
{}

PutCallback

上传完毕回调

请求路径

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
# 响应结果
{}

MultiPutCallback

上传完毕批量回调

请求路径

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
# 响应结果
{}

CreateSegment

创建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
# 响应结果
{}

DeleteSegment

删除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
# 响应结果
{}

ListSegment

获取数据集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
}

UploadLabelCatalog

上传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
{}

GetLabelCatalog

获取数据集标签目录

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"
        }
      ]
    }
  }
}

UploadSensor

上传sensor

POST /v1/datasets/{id}/sensors

Path

Body

请求示例

curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/sensors' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--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"
}'

返回结果

HttpStatus 200
{}

DeleteSensor

删除sensor

DELETE /v1/datasets/{id}/sensors

Path

Body

请求示例

curl --location --request DELETE '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/sensors' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "draftNumber": 1,
    "segmentName": "car",
    "sensorName": "sensor1",
}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{}

ListSensor

获取sensor

GET /v1/datasets/{id}/sensors

Path

Query

请求示例

curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/sensors?segmentName=car&commit=v1' \
--header 'x-token: {your_accesskey}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{
    "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

获取数据集数据列表

GET /v1/datasets/{id}/data

请求参数

Path

Query

请求示例

curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/data?draftNumber=1&segmentName=car'\
--header 'x-token: {your_accesskey}'

返回结果

普通数据集

{
    "segmentName": "car",
    "type": 0,
    "data": [{"remotePath": "car.jpg."}],
    "offset": 0,
    "recordSize": 1,
    "totalCount": 1
}

融合数据集

{
    "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
}

ListDataDetails

获取数据集数据详情列表

GET /v1/datasets/{id}/data/details

请求参数

Path

Query

请求示例

curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/data/details?draftNumber=1&segmentName=car'\
--header 'x-token: {your_accesskey}'

返回结果

普通数据集

{
    "segmentName": "car",
    "type": 0,
    "dataDetails": [{"remotePath": "car.jpg."}],
    "offset": 0,
    "recordSize": 1,
    "totalCount": 1
}

融合数据集

{
    "segmentName": "car",
    "type": 1,
    "dataDetails": [
        {
            "frameId": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
            "frameIndex": 1,
            "frame": [
                {
                    "sensorname": "camera_car",
                    "remotePath": "fusion_data_car3.jpg",
                    "timestamp":1609430401,
                }
            ]
        }
    ],
    "offset": 0,
    "recordSize": 1,
    "totalCount": 1
}

ListDataUri

获取数据资源地址

GET /v1/datasets/{id}/data/urls

请求参数

Path

Query

请求示例

curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/data/urls?draftNumber=1&remotePath=graviti.jpg&segmentName=car' \
--header 'x-token: {your_accesskey}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{
    "offset": 0,
    "recordSize": 5,
    "totalCount": 5,
    "segmentName": "car",
    "urls": [
        {
            "remotePath": "第二段_00000010.jpg",
            "url": "https://content-store-dev-version.oss-cn-qingdao.aliyuncs.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00000010.jpg?Expires=1611304780&OSSAccessKeyId=OSSACCESSKEYID&Signature=DJbZOXSF1FSBQT4wEv69O%2B3OhyI%3D&versionId=CAEQPRiBgMD1o.mEshciIDk4ZmZkMWM2NmQ5ZTQ1NWRhNTBmZDZjNzJjNjM4OGRl"
        },
        {
            "remotePath": "第二段_00040820.jpg",
            "url": "https://content-store-dev-version.oss-cn-qingdao.aliyuncs.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00040820.jpg?Expires=1611304780&OSSAccessKeyId=OSSACCESSKEYID&Signature=DihdFjHDtE3xEyIx3eGbTmN%2B%2Bzc%3D&versionId=CAEQPRiBgMD_pOmEshciIGFjYjVjY2FjYmZkMzRjYjVhZTQ5ZjQxZWMwMzhkOTMx"
        },
        {
            "remotePath": "第二段_00040890.jpg",
            "url": "https://content-store-dev-version.oss-cn-qingdao.aliyuncs.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00040890.jpg?Expires=1611304780&OSSAccessKeyId=OSSACCESSKEYID&Signature=pwhm9liDx9%2BbDp2VlPghd1Kw0as%3D&versionId=CAEQPRiBgMD0pemEshciIGExZDdlOTBjMmQxMDQxMmFiM2QxMTAzNmU3N2I5ODFk"
        },
        {
            "remotePath": "第二段_00040900.jpg",
            "url": "https://content-store-dev-version.oss-cn-qingdao.aliyuncs.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00040900.jpg?Expires=1611304780&OSSAccessKeyId=OSSACCESSKEYID&Signature=GpvY%2BJqbX7qKA70E7t58bRVn%2FcI%3D&versionId=CAEQPRiBgMC9p.mEshciIGY2YzIzNGZmM2EyZDQwMzZiODc4MzNmMmVlY2E0MTAy"
        },
        {
            "remotePath": "第二段_00040940.jpg",
            "url": "https://content-store-dev-version.oss-cn-qingdao.aliyuncs.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00040940.jpg?Expires=1611304780&OSSAccessKeyId=OSSACCESSKEYID&Signature=TguAbiIM0pjWFse1S0MQRUbMuBg%3D&versionId=CAEQPRiBgIDLqemEshciIGM2YmRkZGJlNmY2OTQ5NmViNTEzMDg0NjFmNjczNmYw"
        }
    ]
}

融合数据集

# 响应状态
HttpStatus 200
# 响应结果
{
    "segmentName": "car",
    "type": 1,
    "data": [
        {
            "frameId": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
            "frameIndex": 1,
            "frame": [
                {
                    "sensorname": "camera_car",
                    "remotePath": "第二段_00000010.jpg",
                    "url": "https://content-store-dev-version.oss-cn-qingdao.aliyuncs.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00000010.jpg?Expires=1611304780&OSSAccessKeyId=OSSACCESSKEYID&Signature=DJbZOXSF1FSBQT4wEv69O%2B3OhyI%3D&versionId=CAEQPRiBgMD1o.mEshciIDk4ZmZkMWM2NmQ5ZTQ1NWRhNTBmZDZjNzJjNjM4OGRl"
                }
            ]
        }
    ],
    "offset": 0,
    "recordSize": 1,
    "totalCount": 1
}

ListMaskUrls

获取标注url列表

GET /v1/datasets/{id}/masks/urls

请求参数

Path

Query

请求示例

curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/masks/urls?draftNumber=1&segmentName=car&maskType=SEMANTIC_MASK'\
--header 'x-token: {your_accesskey}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{
    "offset": 0,
    "recordSize": 5,
    "totalCount": 5,
    "segmentName": "car",
    "urls": ["url1","url2"]
}

融合数据集

# 响应状态
HttpStatus 200
# 响应结果
{
    "segmentName": "car",
    "type": 1,
    "data": [
        {
            "frameId": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
            "frameIndex": 1,
            "frame": [
                {
                    "sensorname": "camera_car",
                    "remotePath": "第二段_00000010.jpg",
                    "url": "https://content-store-dev-version.oss-cn-qingdao.aliyuncs.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00000010.jpg?Expires=1611304780&OSSAccessKeyId=OSSACCESSKEYID&Signature=DJbZOXSF1FSBQT4wEv69O%2B3OhyI%3D&versionId=CAEQPRiBgMD1o.mEshciIDk4ZmZkMWM2NmQ5ZTQ1NWRhNTBmZDZjNzJjNjM4OGRl"
                }
            ]
        }
    ],
    "offset": 0,
    "recordSize": 1,
    "totalCount": 1
}

GetDataUrls

根据path获取数据资源地址

POST /v1/datasets/{id}/data/urls-by-paths

请求参数

Path

Body

请求示例

curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/data/urls-by-paths' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "commit":"main",
  "remotePaths":{
    "segment1":["cat.png","dog.png"]
  }
}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{
  "urls":{
    "segment1":{
      cat.png":"https://content-store-prod-version.oss-cn-shanghai.aliyuncs.com/d984afcf439bf3d8.jpg"
    }
  }
}

GetTotalSize

获取所有文件大小

GET /v1/datasets/{id}/total-size

请求参数

Path

Query

请求示例

curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/total-size?commit=main' \
--header 'x-token: {your_accesskey}' 

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{
  "totalSize":66712051577
}

ListCloudFiles

获取云端文件列表

GET /v1/cloud/{configName}/files

请求参数

Path

Query

请求示例

curl --location --request GET '{service}/v1/cloud/aws1/files'\
--header 'x-token: {your_accesskey}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{
  "cloudFiles": ["xxxx","yyyy"],
  "truncated": false,
  "nextMarker": "zzzz"
}

GetCloudFileUrl

获取云端文件列表

GET /v1/cloud/{configName}/files/urls

请求参数

Path

Query

请求示例

curl --location --request GET '{service}/v1/cloud/aws1/files/urls?filePath=xxx'\
--header 'x-token: {your_accesskey}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{
  "url":"example.com/example.jpg"
}

CloudCallback

获取云端文件列表

PUT /v1/datasets/{id}/multi/cloud-callback

请求参数

Path

Body

请求示例

curl --location --request PUT '{service}/v1/datasets/4a9e62ea88fd47b9b4b5f6bbbfe8ef64/multi/cloud-callback'\
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "segmentName": "car",
  "draftNumber": 1,
  "objects":[
    {
      "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"
              }
            ]
          }
        ]
      }
    }
  ]
}

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{}

UploadLabel

上传标签

PUT /v1/datasets/{id}/labels

请求参数

Path

Body

请求示例

curl --location --request PUT '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/labels' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--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"
          }
        ]
      }
    ]
  }
}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{}

ListLabel

获取数据集标签

GET /v1/datasets/{id}/labels

请求参数

Path

Query

请求示例

curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/labels?draftNumber=1&offset=0&limit=1&segmentName=car'\
--header 'x-token: {your_accesskey}'

返回结果 普通数据集

# 响应状态
HttpStatus 200
{
    "segmentName": "car",
    "type": 0,
    "labels": [
        {
           "remotePath": "data_car.jpg",
           "label": {
           
           } 
        }
    ],
    "offset": 0,
    "recordSize": 1,
    "totalCount": 1
}

融合数据集

# 响应状态
HttpStatus 200
{
    "segmentName": "car"
    "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
}

MultiUploadLabel

批量上传标签

PUT /v1/datasets/{id}/multi/data/labels

请求参数

Path

Body

请求示例

curl --location --request PUT '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/multi/data/labels' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "segmentName": "car",
  "draftNumber": 1,
  "objects":[
    {
      "remotePath": "car1.jpg",
      "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"
              }
            ]
          }
        ]
      }
    }
  ]
}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{}

GetLabelStatistics

获取数据集标签数据

GET /v1/datasets/{id}/labels/statistics

请求参数

Path

Query

请求示例

curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/labels/statistics?commit=v1'\
--header 'x-token: {your_accesskey}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{
  "labelStatistics": {
    "CLASSIFICATION":{
        "attributes":null,
        "categories":[
            {
                "attributes":null,
                "name":"0",
                "quantity":6903
            }
        ],
        "quantity":69999
    }
  }
}

ConvertLabelFromAli

从阿里转换标签数据

POST /v1/datasets/{id}/convert-labels

请求参数

Path

Body

请求示例

curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/convert-labels'\
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "commit": "ajhfk2hjk3h89u3i',
    "labelUrl": "https://abc.xyz/ajdfls"
}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{
  "taskId":"6d3a420485984e37abd10436fc4c41de"
}

DeleteData

删除data

DELETE /v1/datasets/{id}/data

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": "test",
    "remotePath": "car1.jpg"
}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{}

OperateData

操作data

POST /v1/datasets/{id}/data

Path

Query

Body

请求示例

curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/data?copy=true' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "draftNumber": 1,
    "segmentName": "test",
    "remotePath": "car1.jpg",
    "source":{
      "remotePath": "carold.jpg",      
      "draftNumber": 1,
      "segmentName": "test",
      "remotePath": "car1.jpg",
      "id": "154e35bae8954f09969ef8c9445efd2c"
    }
}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{}

DeleteFrame

删除frame

DELETE /v1/datasets/{id}/frames

Path

Body

请求示例

curl --location --request DELETE '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/frames' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "draftNumber": 1,
    "segmentName": "test",
    "frameId": "00000009RGDGYHFNXRR8QF2DHJ"
}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{}

GetDiff

获取两版本差异

GET /v1/datasets/{id}/diffs/{baseHead}

请求参数

Path

请求示例

curl --location --request GET '{service}/v1/datasets/11df9efe26644d0d99c566325779b415/diffs/draft-1' \
--header 'x-token: {your_accesskey}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{
    "action":"",
    "segments":{
        "stats":{
            "total":1,
            "additions":0,
            "deletions":0,
            "modifications":1
        }
    },
    "notes":{
        "action":""
    },
    "catalog":{
        "action":""
    },
    "data":{
        "stats":{
            "total":13,
            "additions":0,
            "deletions":13,
            "modifications":0
        }
    }
}

ListSegmentDiffs

获取两版本segment差异列表

GET /v1/datasets/{id}/diffs/{baseHead}/segments

请求参数

Path

Query

请求示例

curl --location --request GET '{service}/v1/datasets/11df9efe26644d0d99c566325779b415/diffs/draft-1/segments' \
--header 'x-token: {your_accesskey}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{
    "segments":[
        {
            "name":"v1.0-mini_scene-0061",
            "action":"modify",
            "data":{
                "stats":{
                    "total":13,
                    "additions":0,
                    "deletions":13,
                    "modifications":0
                }
            },
            "sensor":{
                "action":""
            }
        }
    ],
    "offset":0,
    "recordSize":1,
    "totalCount":1
}

GetSegmentDiff

获取两版本segment差异

GET /v1/datasets/{id}/diffs/{baseHead}/segments/{segmentName}

请求参数

Path

请求示例

curl --location --request GET '{service}/v1/datasets/11df9efe26644d0d99c566325779b415/diffs/draft-1/segments/v1.0-mini_scene-0061' \
--header 'x-token: {your_accesskey}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{
    "name":"v1.0-mini_scene-0061",
    "action":"modified",
    "data":{
        "stats":{
            "total":13,
            "additions":0,
            "deletions":13,
            "modifications":0
        }
    },
    "sensor":{
        "action":""
    }
}

ListDataDiffs

获取两版本数据差异

GET /v1/datasets/{id}/diffs/{baseHead}/segments/{segmentName}/data

请求参数

Path

Query

请求示例

curl --location --request GET '{service}/v1/datasets/11df9efe26644d0d99c566325779b415/diffs/draft-1/segments/v1.0-mini_scene-0061/data' \
--header 'x-token: {your_accesskey}'

返回结果

# 响应状态
HttpStatus 200
# 响应结果
{
    "data":[
        {
            "remotePath":"n015-2018-07-24-11-22-45+0800__CAM_BACK_LEFT__1532402927647423.jpg",
            "action":"delete",
            "file":{
                "action":"delete"
            },
            "label":{
                "action":"unmodify"
            }
        }
    ],
    "offset":0,
    "recordSize":13,
    "totalCount":13
}

最后更新于