graviti
ProductOpen DatasetsApps MarketSolutionsResourcesAbout
Upload Data in Standardized Methods
Upload Data in Standardized Methods
Easily use and manage your cloud data by uploading and reading data via Python SDK or Open API
Manage and Use Different Data with Flexibility
Manage and Use Different Data with Flexibility
Integrate with your data pipeline by uploading, reading, and managing multi-sensor data, time-series continuous data, and annotations via Python SDK or Open API
Comprehensive Use Cases and Documentations
Comprehensive Use Cases and Documentations
Our comprehensive documentations include installation guides, interface tutorials, sample codes, etc., providing users with an effortless experience
Python SDK Example
Use TensorBay via Graviti Python SDK
View the Documents

Install PythonSDK

pip3 install tensorbay

Read images from the dataset

1# !/usr/bin/env python3
2
3from PIL import Image
4from tensorbay import GAS
5from tensorbay.dataset import Segment
6
7gas = GAS("<YOUR_ACCESSKEY>")
8
9dataset = Dataset("<DATASET_NAME>", gas)
10
11segment = dataset["<SEGMENT_NAME>"]
12for data in segment:
13    with data.open() as fp:
14        image = Image.open(fp)
15        width, height = image.size
16        image.show()
17
CLI Example
Use TensorBay in your development environment via Graviti CLI
View the Documents

Configuration

gas auth [YOUR_ACCESSKEY]                                 # Use the AccessKey for the current environment.

Usage

gas dataset                                                 # List the names of all the datasets.

gas dataset tb:<dataset_name>                               # Create a new dataset.

gas ls tb:<dataset_name>                                    # List the names of all the segments of the dataset.

gas ls -a tb:<dataset_name>                                 # List all the files in all the segments of the dataset.

gas ls tb:<dataset_name>:<segment_name>                     # List all the files in a specific segment of the dataset.

gas dataset -d tb:<dataset_name>                            # Delete the dataset.
Open API Examples
Use TensorBay in your development environment via Graviti Open API
View the Documents

Example of Creating a New Dataset

Create a TensorBay dataset with version control. The dataset name must be unique.

Request Path

POST /v1/datasets

Request Parameters

Body

NameTypeRequired?Description
namestringYesDataset name
typeintNoThe default is 0, 0-normal dataset, 1-Fusion dataset
Request Instance
1curl --location --request POST '{service}/v1/datasets' \
2--header 'x-token: {your_accesskey}' \
3--header 'Content-Type: application/json' \
4--data-raw '{
5  "name": "my first dataset",
6  "type": 0
7}'

Output

# Response status
HttpStatus 201
# Response result
{
    "id": "154e35ba-e895-4f09-969e-f8c9445efd2c"
}
  • id: ID of the created dataset