Suite Standard Library
Project description
Cool-tree
Official SDK for managing Suite Platform
Cool-tree can both be used from the command line and as a python library.
Main functions are:
- Manage projects
- Manage Datas
- Manage Labels
Installation
$ pip install spb-cli
$ spb --version
0.0.26
After the installation, spb
executable is available to you.
Usage as a command line interface (CLI)
Getting Started
Authenticate
$ spb config
Account Name: foo
Access Key: bar
Authentication failed. Please try again.
Account Name: foo
Access Key: baz
Profile 'qux' authenticated as account 'foo'
We need an Access Key to authorize each Account.
[~/.spb/config]
[default]
access_key = <access_key>
account_name = <account_name>
List Projects
$ spb project # Lists all projects that belong to the current profile.
NAME LABELS PROGRESS
test 5837 14.3%
...
Upload data
You can upload data and create labels for a project with this CLI. Before that, we need to initialize a workspace linked to the project.
$ spb init test-workspace
Project Name: yest
No such project. Try again.
Project Name: test
Workspace 'test-workspace' for project 'test' has created.
Place your image files (with extension of .jpg, .png, .gif) under the created workspace directory to upload using the following CLI command.
[Directory Structure]
└─ xyz
├─ 1.jpg
└─ abcd
├─ 2.jpg
└─ 3.jpg
[Upload]
$ cd test-workspace
$ spb upload xyz --log result.log
Upload 3 files to project 'test'. Proceed? [y/N] y
33%|████████ | 1/3 [00:01<00:01, 1.13it/s]
'abcd/2.jpg' already exists in dataset 'xyz'. Use existing data? [y/N] y # use -f option for yes to all
100%|████████████████████████| 3/3 [00:03<00:00, 1.27it/s]
[result.log]
2000-01-01 00:00:00.000 xyz/1.jpg dataset xyz data_key 1.jpg label_id foo
2000-01-01 00:00:00.100 xyz/abcd/2.jpg dataset xyz data_key abcd/2.jpg label_id bar
2000-01-01 00:00:00.200 xyz/abcd/3.jpg dataset xyz data_key abcd/3.jpg label_id baz
Pre-labeling for upload data
If you have JSON files placed as in the below structure and upload, the label is initialized with the content of the JSON file. To understand how to construct JSON file in the correct format, please refer to Superb Suite Manual.
└─ xyz
├─ 1.jpg
├─ 1.jpg.json
└─ abcd
├─ 2.jpg
├─ 2.jpg.json
├─ 3.jpg
└─ 3.jpg.json
Download labels
You can download images and labels for the project in the workspace.
The result is exactly same to the directory structure of pre-labeling for uploading.
$ spb download
Download 3 files from project 'test'. Proceed? [y/N] y
100%|████████████████████████| 3/3 [00:03<00:00, 1.27it/s]
Download된 라벨을 조작하여 다른 프로젝트의 초기값으로 사용할때, 이 파일 구조를 그대로 유지한 상태에서 upload할 수 있습니다.???????
Update labels
ex)
# The set-up is identical to the one of upload data.
$ spb upload xyz
Upload 3 files to project 'test'. Proceed? [y/N] y # This part is same to the upload command.
'1.jpg' already exists in project 'test'. Update label only? [y/N] y # Since label exists already, it requires confirmation to update. -f option for forceful update.
...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.