Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] docs: import & upload annotation #10

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
105 changes: 105 additions & 0 deletions src/en/datasets/async-import-annotation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
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,
"successTaskList": [
{
"taskId": "23412341235234234",
"dataId": "2392"
},
{
"taskId": "9182748910723984",
"dataId": "9782"
}
],
"errorDataIdList": ["98902", "1234"]
},
"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-->
33 changes: 32 additions & 1 deletion src/en/datasets/common-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,26 @@
"description": "Data Entry Id from your file"
}
}
},
"successTaskList": {
"type": "object[]",
"description": "Mapping list between task id and data id",
"required": false,
"properties": {
"taskId": {
"type": "string",
"description": "Data Entry Id from task"
},
"dataId": {
"type": "string",
"description": "Data Entry Id in our platform"
}
}
},
"errorDataIdList": {
"type": "object[]",
"description": "Mapping list error annotation task id",
"required": false
}
}
```
Expand All @@ -47,7 +67,18 @@
"dataId": "111",
"sceneId": "111112"
}
]
],
"successTaskList": [
{
"taskId": "23412341235234234",
"dataId": "2392"
},
{
"taskId": "9182748910723984",
"dataId": "9782"
}
],
"errorDataIdList": ["98902", "1234"]
},
"date": "2024-05-17 16:04:53",
"requestId": "71c3ddd6171593314607810011afb4",
Expand Down
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-->