SelectDataset
Introduction
SelectDataset
widget is a dropdown menu that allows users to select a dataset or multiple datasets from a list of available datasets in the current project. It displays the name of each dataset in the list.
Function signature
Parameters
Parameters | Type | Description |
---|---|---|
|
|
|
|
|
|
|
| Allow to select all datasets in current project |
|
| Show only dataset select |
|
| Show label |
|
| Selector size |
|
| Disable dataset select |
|
| ID of the widget |
|
| Select all datasets |
|
| List of allowed project types |
default_id
Determine Dataset
will be selected by default.
type: int
default value: None
project_id
Determine Project
will be selected by default.
type: int
default value: None
multiselect
Allow to select multiple datasets in current project.
type: bool
default value: false
compact
Show only Dataset
select.
type: bool
default value: false
show_label
Determine show text Dataset
on widget or not, work only if compact
is True.
type: bool
default value: True
size
Size of input.
type: Literal["large", "small", "mini", None]
default value: None
disabled
Determine Dataset
select ability.
type: bool
default value: false
select_all_datasets
Select all datasets in current project. Work only if multiselect
is True
.
type: bool
default value: false
allowed_project_types
List of allowed project types.
type: List[ProjectType]
default value: None
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
Attributes and Methods | Description |
---|---|
| Return selected |
| Return selected |
| Return id of selected Project, if |
| Set current project id. |
| Set |
| Set |
| Decorator functions is handled when selected |
Mini App Example
You can find this example in our Github repository:
ui-widgets-demos/selection/005_select_dataset/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Prepare project_id
and dataset_id
project_id
and dataset_id
Initialize SelectDataset
widget
SelectDataset
widgetCreate app layout
Prepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create app using layout
Create an app object with layout parameter.
Last updated