Skip to content

Commit

Permalink
Merge pull request #8 from stardustai/annotation
Browse files Browse the repository at this point in the history
docs: import & upload annotation
  • Loading branch information
1210958801 authored Oct 10, 2024
2 parents adf3f38 + ee0072d commit 1c3d4cb
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .vitepress/config/en.mts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export const en = defineConfig({
items: [
getApiConfig('/datasets/sync-upload'),
getApiConfig('/datasets/async-import'),
getApiConfig('/datasets/async-import-annotation'),
getApiConfig('/datasets/sync-upload-annotation'),
getApiConfig('/datasets/get-status')
]
},
Expand Down
2 changes: 1 addition & 1 deletion .vitepress/config/shared.mts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const getApiTitle = (title: string, method: 'GET' | 'POST') => {
return `
<span class="flex justify-between items-center">
<span>${title}</span>
<span class="text-[8px] w-9 h-4 rounded-xl text-white text-center leading-4 ${bg}">${method}</span>
<span class="flex-shrink-0 text-[8px] w-9 h-4 rounded-xl text-white text-center leading-4 ${bg}">${method}</span>
</span>`
}

Expand Down
94 changes: 94 additions & 0 deletions src/en/datasets/async-import-annotation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
title: Import Dataset & Annotation Request
description: This page will help you get started with importing a dataset from cloud storage asynchronously and annotation request, you need to put the files according to a specific file tree structure, refer to [File tree](#file-tree).
api:
method: POST
url: /dataset/annotation/import/async
---

<!-- You can use the cloud storage of the platform, or your own storage which follow the S3 protocol, in second case, you need to pass the relevant authentication parameters, such as AccessKey, SecreteKey, Endpoint, VendorType.
-->

::: request

```json [body]
{
"resourceUrl": {
"type": "string",
"description": "The resource url on cloud storage, start with gs://bucket-name/"
},
"fileTreeType": {
"type": "string",
"description": "[File tree](#file-tree) in storage: 0 represents sensor oriented."
},
"dataType": {
"type": "integer",
"description": "Data type: 2 represents 2D, 3 represents 3D."
},
"name": {
"type": "string",
"description": "Dataset name, the maximum length limit is 60 bytes."
},
"projectId": {
"type": "long",
"description": "Items that need to be annotation request, the project id which returned by [Create Project](/projects/create-project)"
},
"externalStorage": {
"type": "object",
"hidden": true,
"required": false,
"properties": {
"accessKey": {
"type": "string",
"description": ""
},
"secreteKey": {
"type": "string",
"description": ""
},
"endpoint": {
"type": "string",
"description": ""
},
"vendorType": {
"type": "string",
"description": ""
}
}
}
}
```

:::

::: result

```json [responses]
{
"200": {
"code": 200,
"message": "Success",
"data": {
"datasetId": "1",
"status": 1
},
"date": "2024-05-16 19:03:34",
"requestId": "864b70706a7349ea83e177a49800464f",
"success": true
},
"5710": {
"code": 5710,
"data": null,
"date": "2024-05-16 19:03:34",
"message": "File tree misalignment, refer to API doc for correction",
"requestId": "864b70706a7349ea83e177a49800464f",
"success": false
}
}
```

:::

## File tree

<!--@include: filetree.md-->
49 changes: 49 additions & 0 deletions src/en/datasets/sync-upload-annotation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: 'Upload Dataset & Annotation Request'
description: This page will help you get started with uploading a local dataset zip file to Rosetta synchronously, and annotation request, the file size should be less than 100MB, and you need to put the files according to [File tree](#file-tree).
api:
method: POST
url: /dataset/annotation/upload/sync
---

::: request

```json [headers]
{
"Content-Type": { "type": "string", "default": "multipart/form-data" }
}
```

```json [body:form]
{
"uploadFile": {
"type": "file",
"description": "Local zip file path",
"default": "dataset.zip"
},
"fileTreeType": {
"type": "integer",
"description": "[File tree](#file-tree) in zip file: 0 represents sensor oriented."
},
"dataType": {
"type": "integer",
"description": "Data type: 2 represents 2D, 3 represents 3D."
},
"name": {
"type": "string",
"description": "Dataset name, the maximum length limit is 60 bytes."
},
"projectId": {
"type": "long",
"description": "Items that need to be annotation request, the project id which returned by [Create Project](/projects/create-project)"
}
}
```

:::

<!--@include: common-response.md-->

## File tree

<!--@include: file-tree.md-->

0 comments on commit 1c3d4cb

Please sign in to comment.