Skip to content

Latest commit

 

History

History
181 lines (130 loc) · 5.77 KB

File metadata and controls

181 lines (130 loc) · 5.77 KB

BSTLD

This topic describes how to manage the BSTLD Dataset, which is a dataset with reference/label_format:Box2D label(Fig. %s <example-bstld>).

The preview of a cropped image with labels from "BSTLD".The preview of a cropped image with labels from "BSTLD".

Authorize a Client Instance

An reference/glossary:accesskey is needed to authenticate identity when using TensorBay.

../../../docs/code/BSTLD.py

Create Dataset

../../../docs/code/BSTLD.py

Organize Dataset

It takes the following steps to organize the "BSTLD" dataset by the ~tensorbay.dataset.dataset.Dataset instance.

Step 1: Write the Catalog

A reference/dataset_structure:catalog contains all label information of one dataset, which is typically stored in a json file.

../../../tensorbay/opendataset/BSTLD/catalog.json

The only annotation type for "BSTLD" is reference/label_format:Box2D, and there are 13 reference/label_format:category types and one reference/label_format:attributes type.

Important

See catalog table <reference/dataset_structure:catalog> for more catalogs with different label types.

Step 2: Write the Dataloader

A reference/glossary:dataloader is needed to organize the dataset into a ~tensorbay.dataset.dataset.Dataset instance.

../../../tensorbay/opendataset/BSTLD/loader.py

See Box2D annotation <reference/label_format:Box2D> for more details.

Note

Since the BSTLD dataloader <BSTLD-dataloader> above is already included in TensorBay, so it uses relative import. However, the regular import should be used when writing a new dataloader.

../../../docs/code/BSTLD.py

There are already a number of dataloaders in TensorBay SDK provided by the community. Thus, instead of writing, importing an available dataloader is also feasible.

../../../docs/code/BSTLD.py

Note

Note that catalogs are automatically loaded in available dataloaders, users do not have to write them again.

Important

See dataloader table <reference/glossary:dataloader> for dataloaders with different label types.

Visualize Dataset

Optionally, the organized dataset can be visualized by Pharos, which is a TensorBay SDK plug-in. This step can help users to check whether the dataset is correctly organized. Please see features/visualization:Visualization for more details.

Upload Dataset

The organized "BSTLD" dataset can be uploaded to TensorBay for sharing, reuse, etc.

../../../docs/code/BSTLD.py

Similar with Git, the commit step after uploading can record changes to the dataset as a version. If needed, do the modifications and commit again. Please see features/version_control:Version Control for more details.

Read Dataset

Now "BSTLD" dataset can be read from TensorBay.

../../../docs/code/BSTLD.py

In reference/dataset_structure:dataset "BSTLD", there are three segments <reference/dataset_structure:segment>: train, test and additional. Get the segment names by listing them all.

../../../docs/code/BSTLD.py

Get a segment by passing the required segment name.

../../../docs/code/BSTLD.py

In the train reference/dataset_structure:segment, there is a sequence of reference/dataset_structure:data, which can be obtained by index.

../../../docs/code/BSTLD.py

In each reference/dataset_structure:data, there is a sequence of reference/label_format:Box2D annotations, which can be obtained by index.

../../../docs/code/BSTLD.py

There is only one label type in "BSTLD" dataset, which is box2d. The information stored in reference/label_format:category is one of the names in "categories" list of catalog.json <BSTLD-catalog>. The information stored in reference/label_format:attributes is one or several of the attributes in "attributes" list of catalog.json <BSTLD-catalog>. See reference/label_format:Box2D label format for more details.

Delete Dataset

../../../docs/code/BSTLD.py