SelectItem
Last updated
Last updated
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.
Determine Supervisely dataset from which items will be selected.
type: int
default value: None
Show only Dataset
select.
type: bool
default value: true
Determine show text Item
on widget or not.
type: bool
default value: True
Size of input.
type: Literal["large", "small", "mini", None]
default value: None
ID of the widget.
type: str
default value: None
You can find this example in our Github repository:
ui-widgets-demos/selection/006_select_item/src/main.py
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Dataset
IDSelectItem
widgetPrepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create an app object with layout parameter.
Parameters | Type | Description |
---|---|---|
Attributes and Methods | Description |
---|---|
dataset_id
int
Dataset
ID
compact
bool
Show only dataset select
show_label
bool
Show label
size
Literal["large", "small", "mini", None]
Selector size
widget_id
str
ID of the widget
get_selected_id()
Return selected item id.
refresh_items(dataset_id: int = None, limit: int = 50)
Update items by given dataset id.