SelectProject
Last updated
Last updated
SelectProject
widget in Supervisely is a dropdown menu that allows users to select a project from a list of available projects in current workspace. Clicking on it can be processed from python code. This widget is particularly useful when working with multiple projects in Supervisely and allows to easily switch between projects in applications.
default_id
int
Project ID
workspace_id
int
Workspace ID
compact
bool
Show compact view of project selector widget
allowed_types
List[ProjectType]
List of project types witch will be available to select
show_label
bool
Show label
size
Literal["large", "small", "mini", None]
Selector size (large/small/mini)
widget_id
str
ID of the widget
Determine Project
will be selected by default.
type: int
default value: None
Determine Workspace
will be selected by default.
type: int
default value: None
Show only Project
select.
type: bool
default value: false
List of project types witch will be available to select. Set one of available sly.ProjectType
s: IMAGES
, VIDEOS
, VOLUMES
, POINT_CLOUDS
, POINT_CLOUD_EPISODES
.
type: List[ProjectType]
default value: []
Determine show text Project
on widget or not. This parameter only affects when parameter compact
is True
.
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
get_selected_id()
Return selected project id.
set_project_id()
Set current project id.
@value_changed
Decorator function to detect changes in selector.
You can find this example in our Github repository:
ui-widgets-demos/selection/004_select_project/src/main.py
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
project_id
and workspace_id
SelectProject
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.