SelectItem
Introduction
SelectItem
widget can show selector for project items (depending on project type:image
, video
, volume
, point_cloud
or point_cloud_episode
), clicking on it can be processed from python code. In this tutorial you will learn how to use SelectItem
widget in Supervisely app.
Function signature
Parameters
Parameters | Type | Description |
---|---|---|
|
|
|
|
| Show only dataset select |
|
| Show label |
|
| Selector size |
|
| ID of the widget |
dataset_id
Determine Supervisely dataset from which items will be selected.
type: int
default value: None
compact
Show only Dataset
select.
type: bool
default value: true
show_label
Determine show text Item
on widget or not.
type: bool
default value: True
size
Size of input.
type: Literal["large", "small", "mini", None]
default value: None
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
Attributes and Methods | Description |
---|---|
| Return selected item id. |
| Update items by given dataset id. |
Mini App Example
You can find this example in our Github repository:
ui-widgets-demos/selection/006_select_item/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Prepare Dataset
ID
Dataset
IDInitialize SelectItem
widget
SelectItem
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